Three times in American history, the Supreme Court has been asked to speak to a law, neutral on its face, yet rooted in a popular hatred or intolerance of minorities. Three times, it has chosen to ignore the real reasons for the law.

Three times, it has instead given a free pass to laws and policies predicated on discriminatory judgments that our Constitution supposedly bars.

The first was Plessy v. Ferguson. In 1896, the Plessy Court upheld Homer Plessy’s conviction under Louisiana’s law mandating “equal but separate” railroad carriages. The central plank of the Court’s argument was simple: If Homer Plessy experienced a “badge of inferiority,” it was “not by reason of anything found in the act,” but “solely” because he chose to view the law that way.

The second was Korematsu v. United States ­ — the Japanese internment camp case. Famously, the case upheld in 1944 an executive order by President Franklin Roosevelt, authorizing “military areas … from which any or all persons may be excluded.” The Court reviewed “evidence” that Congress had gathered about the Japanese government’s “dissemination of propaganda and … maintenance of … influence” among Japanese Americans.

It carefully framed its Korematsu opinion as focused on a policy of “exclusion,” ignoring the network of civilian assembly centers and “relocation” camps — as the internment camps were euphemistically known — that ultimately held between 110,000 and 120,000 people.

The Court expressly refused to look beyond these proffered justifications — justifications that in the fullness of time were revealed as false. Rather, it rejected the discrimination issue because it “merely confuses the issue.” Emphasizing that “we are at war” and that “time was short,” the Court deferred to the decision of “properly constituted military authorities.”

Even at the time, the problem with this logic was apparent: As Justice Robert Jackson cautioned, the Court’s embrace of the deference meant that judges would “never have any real alternative to accepting the mere declaration of the authority that issued the order that it was reasonably necessary from a military viewpoint.”

When the Supreme Court ignores the clearly discriminatory intent of laws, it goes badly astray

The third case, of course, is Hawaii v. Trump. In upholding the president’s travel ban, both Chief Justice John Roberts’s bare majority opinion and Justice Anthony Kennedy’s concurring opinion go out of their way to reject the suggestion that religious animus motivated the ban, and they distance the Court from President Donald Trump’s many hateful and discriminatory statements about Muslims.

The majority opinion quoted a few, brief snippets of the president’s anti-Muslim remarks. But it was left to Justice Sonia Sotomayor, in her dissent, to remind us of just how numerous and nasty those remarks were. She noted, among other examples, Trump’s recurring obsession with the massacre of Muslims in the Philippines by Gen. John J. Pershing, in the early 1900s.

Trump at least twice approvingly repeated the apocryphal story that Pershing’s troops used bullets dipped in pigs’ blood as they executed Philippine insurgents. (The theme of no due process for racial and religious minorities is hard to miss).

The justices’ assertion that the president’s words do not reflect the religious neutrality of the policy, as written, is empty. The logical core of the travel ban decision is the idea that the government prevails in a national security case so long as it can muster some — any — trace of evidence of a legitimate motive. So long as a policy is “plausibly related to the Government’s stated objective to protect the country,” Chief Justice Roberts explained, it survives constitutional attack.

The Supreme Court framed its inquiry as an application of what is called “rational basis” review. But even when it uses a rational review lens, the Court has in the past been willing to see a discriminatory policy for what it truly is. Not so today. Indeed, one reading of the Court’s opinion is that there is no amount of evidence of discriminatory motives that could matter in a national security case — provided there is even one trace of a legitimate public order motive.

The Supreme Court’s new test means surrendering its independent judgment in national-security cases

If that’s true, the courts are toothless as a check on discrimination. Court challenges are then Kabuki theater, not a quest for compliance with our best ideals. The world is complex enough, and empirically messy enough, that it will simply always be possible for governments to whip up a “rational” justification for illegitimate acts, even if the true motivations are quite different. I can imagine almost no national security or immigration policy, even if justified to the public in terms of pure animus, and adopted in that spirit, that could not be re-described in way that would pass the test the Supreme Court just used.

Notably, this includes the Japanese internment. Under the Court’s “plausibly related” test, it is quite clear that the internment would have survived a constitutional challenge today: As the Korematsu majority explained, the government presented reasons why Japanese-Americans posed threats to national security threats, reasons that had nothing to do with race or ethnicity.

Thus, when Chief Justice Roberts claims that his decision has “nothing to do” with the Japanese internment case, and that it is “wholly inapt” to compare the two situations — he even slams the minority for striving for a cheap “rhetorical advantage” by mentioning the case — don’t believe it. When Roberts says that Korematsu was “gravely wrong the day it was decided,” and not good law, this is in stark tension with his own reasoning in the case at hand.

Both today and in 1944, the government could point to a scintilla of evidence for its policy. In both eras, moreover, discriminatory animus could easily be obscured by expanding the scope of a policy to cover others beyond the targeted minorities. The orders at issue in Korematsu, for example, also reached German and Italian citizens. The executive order at issue in Trump v. Hawaii reached some Venezuelans and North Koreans.

To be sure, the Korematsu case concerned a US citizen — but it is worth recalling that a large fraction of those detained were not citizens. (In any case, Chief Justice Roberts himself has in an earlier case, involving the First Amendment, crafted a watered-down version of judicial review for citizens’ constitutional rights.)

Promise to discriminate, clean up the language later. Then get rubber-stamped.

The result of today’s decision is that discrimination on racial and religious grounds is now de facto permissible — so long as it done under the rubric of immigration or national security. If there is what the Plessy Court called a “badge of inferiority” affixed to some because of their race or imputed religion, it is once more “solely” the result of their own imaginations.

The racial and religious minorities — citizens and noncitizens alike — who are at the sharp end of the travel ban’s discriminatory focus have reason to fear. The Court’s decision does more than recapitulate some of the worst opinions of our constitutional history.

It also condones a morally compromised style of governing in which policies are launched by an appeal to raw fear and hatred, and then whitewashed at the back end by a small measure of bureaucratic wheel-spinning.

This style of populism is in ascendance today. Expectations that the travel ban will be its first and last result are wishful thinking — thanks to the Supreme Court’s tone-deaf and morally obtuse judgment Tuesday.

Those hoping that the Court had learned something from Plessy and Korematsu will be disappointed. It hasn’t. I fear it is vulnerable racial and religious minorities that will pay the price. If they do, the Court deserves much of the blame.

Aziz Huq is the Frank and Bernice J. Greenberg professor of law at the University of Chicago Law School. For more on the SCOTUS ruling, listen to the June 26 episode of Today Explained.

The Big Idea is Vox’s home for smart discussion of the most important issues and ideas in politics, science, and culture — typically by outside contributors. If you have an idea for a piece, pitch us at thebigidea@vox.com