No matter what side of the issue you are on it is the legislative branch that writes the laws. In this case the executive branch is executing policy that violates that law. Less than an 8-0 against the government shows the partisanship of the Court.
Nobody should be surprised at this. This is largely the same court that rewrote the ACA bill to make Obamacare legal and undermine the right to property with the abysmal Kelo decision.