If he was merely being prosecuted for being an illegal immigrant, fine, deport him and that should be the end of it.

If he was wrongfully prosecuted (as would seem to be the case for the crime he was in jail for) he should be able to sue. If false statements were made to indict him, then the state should go after the accusers for legal costs.