Immigration 'mostly' falls under plenary powers of The Congress and the courts have little to no authority in these matters (similar to how Presidential pardons may not be overturned by the Court or Congress). This legal theory has been changing over time but it still mostly holds.

https://en.wikipedia.org/wiki/Plenary_power https://cis.org/Report/Plenary-Power-Should-Judges-Control-U...