I don’t just mean most gratifying to one side or the other from a given political or policy point of view; I mean right as a matter of serious constitutional law. What would that be?

The court should hold that the ban is a palpable and categorical violation of the First Amendment’s prohibition of “an establishment of religion”—one of the worst such violations in American history.

So far, the lower courts have offered the Supremes two ways to decide against Trump. The Ninth Circuit dodged the constitutional issue; instead, its panel reasoned that the ban violates the Immigration and Nationality Act. That statute, the court’s panel argued, forbids an order banning immigrant visas on the basis of nationality. And even if the administration claims an emergency that would justify such a ban, the panel said, the president has not taken the procedural steps required by the INA and the Refugee Act of 1980 before issuing it.

By contrast, the Fourth Circuit went big. Because “the reasonable observer would likely conclude that [the order’s] primary purpose is to exclude persons from the United States on the basis of their religious beliefs,” the en banc court held, the ban violates the Establishment Clause rights of one or more of the individual plaintiffs.

Affirming either opinion will require the court to go well beyond existing precedent. The statutory route will involve looking hard at the administration’s claims of a “national security” rationale for the ban—something courts have been reluctant to do in the immigration context. And the rule against establishment of religion has never—as near as I can tell—been applied in the context of immigration law.

Establishment clause cases are bedeviled by one issue: Whose rights are violated by an “establishment of religion”? The paradox is that because “establishment” violates everybody’s rights, it often does not—under the “standing to sue” doctrine used by the federal courts—violate any particular person’s rights enough to give rise to a “justiciable” lawsuit. Individuals in federal court are supposed to have “particularized” injury—otherwise, the logic runs, they are simply using the federal courts to pursue “generalized grievances” against the government, and should instead turn to the political process.

The Warren Court found a limited exception for “establishment” cases in 1968: The essence of the clause, it said, bars using individuals’ tax money to benefit religion; thus a taxpayer can challenge legislative appropriations of money for religious uses.

Subsequent courts have proved skittish about extending the rule. Under a 1982 precedent, taxpayers can’t challenge transfers of government property to religious bodies, since those aren’t tax funds. In 2007, the Roberts Court held that no one could sue to stop the Bush White House’s promotion of “faith-based” programs; since the program was funded by the office of the President’s overall congressional appropriation, there was no specifically religious appropriation to challenge. In 2011, the court held that taxpayers could not challenge state tax credits for contributions to religious schools, since the benefit to religion was the result of the individual taxpayers’ free choice, not that of the state.