The ruling doesn't touch the legal standing of the executive branch to enforce laws, or the legality of the specific law in question. My guess is that the Administration will have to prove irreparable harm and/or that the federal government's interests outweigh the states'. Interference in constitutional responsibilities will hopefully win this case for the federal government.
It has become a universal belief among liberals and Millennials that the US Bill of Rights applies to citizens of other countries. This pernicious myth is nearly impossible to eradicate - they just stop up their ears and refuse to listen.