As a matter of power, there is no question that Congress has effectively total power to exclude anyone it wants from the United States, subject to collision with some enforceable rights; Article I establishes that power. And it has a lot of leeway to delegate aspects of that power to the president, either ordering him to enforce rules or empowering him to fill in the gaps. The president currently has a fair amount of authority in this area (not unlimited; President Obama, for example, likely exceeded his authority by a blanket assertion that he could turn “prosecutorial discretion” into an affirmative grant of legal status). It’s debatable whether Trump has been given all the authority he needs to issue this order – Andrew McCarthy says yes, while Patterico says no.
But if he does have the authority, then the only remaining question is one of rights. Yet, in a line of cases running from the Court upholding the Chinese Exclusion Act in 1889 to a 1972 case effectively holding that prospective Communist immigrants have no right to raise free speech challenges to their exclusion on grounds of political viewpoints, the Court has taken the position that Congress’ plenary power in this area is not restricted by any individual rights, since foreigners have no such rights to enter the country (the 1972 case also held that Americans don’t have constitutional rights to demand the admission of an immigrant).
That seems to leave challengers hanging their entire hat on the idea that any preference for religious minorities in refugee admissions violates the Establishment Clause, on the theory that this is the effective equivalent of turning federal immigration law into a state church. This is a novel argument (its novelty is one reason I think Sally Yates had no good-faith basis to conclude that the order was unenforceable) but it matters for standing-to-sue purposes because the Court has long allowed a much broader array of people (effectively, any taxpayer) to sue over Establishment Clause violations than any other Constitutional violation.
It’s unfortunate that Judge Robart’s decision, like the one handed down last weekend in the Eastern District of New York, includes nearly no legal reasoning or explanation, such that we could judge why he found the order unconstitutional or illegal.