Taxpayer faces massive compensation payout as High Court rules hundreds of immigrants should not be locked up in detention centres