The ruling a few weeks ago in Masterpiece Cakeshop was a poor omen for Trump in this case since it focused on antipathy to religion. The state of Colorado’s antidiscrimination panel was openly hostile to Jack Phillips’s faith, noted Anthony Kennedy in writing for the Court. The state can’t do that.

Some critics noted at the time that that’s the same argument being pushed by opponents of Trump’s travel ban. How many times has he said something critical of Islam? Wasn’t the very first iteration of the travel ban on the campaign trail in 2015 a call to ban all Muslims from the United States temporarily? The lower-court rulings were filled with quotes from Trump himself and from his advisors suggesting hostility to Islam. If animus to religion was enough to blow up Colorado’s antidiscrimination policy (at least as applied to Jack Phillips), surely it should be enough to blow up POTUS’s travel ban for the same reasons.

Nope. Two big differences in the travel-ban case, argues John Roberts on behalf of the Court. The president has vast authority over immigration policy. And because immigration policy burdens non-citizens, the Court’s standard of review is more deferential to the executive. Result: 5-4 to uphold the ban, with the five conservatives forming a majority and the Court’s liberals voting as usual as a bloc in every single case that matters. You have to go back to Byron White to find a Democratic appointee as unorthodox as Kennedy or David Souter or John Paul Stevens or Sandra Day O’Connor or even John Roberts were/are among Republican appointees.

Needless to say, Gorsuch’s vote in Trump’s favor here is rewarding both to POTUS and to the many Republicans who held their nose and voted Trump two years ago largely to maintain conservative control of the Court. There’s zero doubt how Justice Merrick Garland would have voted, for exactly the reason I just gave. There are no Democratic justices who break with their pack. If there were, the cutthroat politics of SCOTUS nominations might be a little (emphasis: a little) less cutthroat.

The key bit in the opinion is the Establishment Clause analysis related to Trump’s statements about Muslims. I’ll address that in an update — stay tuned — but want to post the rest of this now so that people can comment. Here’s the opinion.

Update: Mitch McConnell says you’re welcome, America.

Update: Trump’s excited too:

Update: Alright, the Establishment Clause section begins on page 30 of Roberts’s majority opinion. The plaintiffs’ argument is that by seeking to restrict entry from mostly Muslim countries (originally exclusively Muslim countries in the initial version of the ban), the executive branch is guilty of religious bias in violation of the First Amendment. Normally, in claims involving constitutional rights, the Court will apply what’s known as “strict scrutiny” in analyzing government actions — unless the state can show that its policy is narrow and aimed at achieving a “compelling” government interest, it’ll be struck down. In claims not involving constitutional rights, though, the Court typically applies “rational basis” scrutiny — essentially, all the state has to do is show that there’s some rational basis for the action it took in pursuit of a legitimate state function. No “compelling” purpose or “narrow” tailoring required. In practice, laws that are subject to strict scrutiny are almost always struck down as unconstitutional whereas laws that are subject to rational-basis review are almost always upheld as constitutional.

And so the big question here was, which standard would the Court apply? The travel ban itself is “neutral” in terms of religious bias but Trump’s many comments about Muslims suggest discriminatory purpose. Under a rational-basis test, the Court might ignore Trump’s statements and decide that as long as there’s some national-security logic to the policy, Trump’s bias doesn’t matter. A strict-scrutiny test would likely look beyond that and demand compelling evidence that the travel ban was both important to national security and was the least aggressive means of achieving the feds’ objectives. Which means the policy would likely be struck down.

Rational-basis review in this case, says Roberts. He begins:

Once again, he stresses, the executive gets wiiiiiiide latitude in immigration, a core sovereign function. Which means:

In other words, in specific areas like immigration where the president has broad constitutional power, the test used to analyze the constitutionality of his actions is necessarily more relaxed. The upshot, per Ken White:

Lefty Benjy Sarlin puts it another way:

Not “disconnected” from policy, just not sufficient to spoil a policy that’s facially neutral. Theoretically, Trump could seal the border and declare that he’s doing it because Latinos are “dirty” and the policy would be upheld because, after all, there are neutral reasons to want stronger borders.

Update: Blink and you’ll miss it but SCOTUS also overruled the notorious holding in Korematsu v. United States in today’s ruling. Korematsu’s the WWII-era case in which the Supreme Court upheld Japanese internment camps.

I see both sides there. Roberts’s point is straightforward: The executive’s authority over citizens is different from his authority over foreigners inside the U.S. And obviously the deprivation of liberty in Korematsu is far, far more severe than being denied a visa to the United States. But the dissent is trying to turn Roberts’s strict scrutiny/rational basis logic back on him. If it’s true that the Court should be less critical of presidential action in cases where the executive enjoys unusual authority, even if there’s evidence of improper discriminatory motive behind his policy, then why shouldn’t internment camps of citizens be allowed? Surely the executive enjoys immense authority over war. At the very least, by Roberts’s logic, shouldn’t interning Japanese-Americans be analyzed by a rational-basis standard rather than a strict-scrutiny standard? (Whether it would survive even rational-basis analysis is a separate question.)