The government’s response to the courts is, in short, butt out. Mr. Trump can exclude whomever he wants in order to protect the country from attack, and no judge may second-guess him. That’s an astonishing claim of unchecked executive authority. It also contradicts the structure of federal immigration law, which is the province of Congress. No one is saying that the president is powerless to protect the nation from attack. What they are saying is that he must do so without violating the law or the Constitution.

Speaking of the Constitution, and especially of the First Amendment’s establishment clause, anyone with a passing awareness of American politics knows what’s at the root of the travel ban: Mr. Trump’s special animus against Muslims, which he’s been nursing at least since December 2015. That’s when he called for a “total and complete shutdown” of Muslims entering the country until we “can figure out what is going on.” Since then he has given his lawyers a constant headache by tweeting regularly about the ban, saying just days before the latest version that it should be “far larger, tougher and more specific,” but that this would be “politically incorrect.” In case anyone was still unclear about where he stands, last November the president retweeted inflammatory videos from a fringe ultranationalist group in Britain showing Muslims purportedly engaged in violence. (The videos were, as Mr. Trump likes to say, fake news.)

From this angle, the travel ban looks a lot like Mr. Trump’s other attempts to weaponize the federal government in the service of his own personal vendettas. Remember the election integrity commission? An entire operation created solely to justify the president’s false claims that millions of people voted illegally in 2016. The commission folded in January without making any findings of fraud. In the case of the travel ban, Mr. Trump is surrounded by anti-immigrant hard-liners, including his attorney general, Jeff Sessions, who donated one of his favorite staffers, a zealot named Stephen Miller, to help draft the ban.

In truth, the latest proclamation functions as little more than legal backfill “to legitimize a presidential command that was born of animus, persists in animus, and seeks to make animus the law of the land,” as a supporting brief says.

That brief is one of many the court has received arguing against the ban; more than four times as many briefs oppose the ban as support it. They come from immigrants’-rights groups and anti-discrimination advocates, naturally, but also from business and legal leaders, scholars of constitutional and international law, conservatives and liberals and libertarians, cities and states — and, notably, former national security and military officials, who warn that by encouraging the perception that the United States is anti-Muslim, it “jeopardizes the stability of the support that the United States receives from its allies, erodes essential good will, makes it more difficult for the United States to win hearts and minds abroad.”

This leads the justices to a thornier question: What to do with a president like Mr. Trump? Should they simply ignore everything he’s said? Are they holding him to a different standard than previous presidents? That’s hard to answer, because no past president behaved like Mr. Trump. In its brief to the justices, the administration argues that the court must not engage in “judicial psychoanalysis of a drafter’s heart of hearts.” But there’s no need to get Mr. Trump on a couch. He’s said over and over exactly what he thinks.

The Supreme Court has been faced with situations like this before. In World War II, it bowed to claims of unfettered executive authority and allowed American citizens to be locked up for years simply because of their Japanese heritage. It was a shameful moment for the court and for the United States. Today, in the face of an executive order again based on racial animus and unfounded fears, the justices have the chance to deliver a very different message about executive power, and the meaning of America.