The Supreme Court on Thursday handed a narrow victory — unanimous in result but not reasoning — to a Catholic foster-care agency in Philadelphia that refused on religious grounds to place children in same-sex households. A coalition of liberal and conservative judges seemed to have crafted a compromise of sorts — one that grants organizations contracting with governments some freedom to deny services to gay and lesbian clients for religious reasons. Yet the decision did not go as far as the most conservative members of the court would like in redefining religious liberty.

The compromise in Fulton v. Philadelphia is built on sand. It invites extensive and messy litigation by religious entities seeking to discriminate or impose their views of sexual morality on nonbelievers. That litigation will thwart efforts to balance competing values. Rather than tamping down the culture war between the conservative religious lobby and its progressive opponents, Fulton is likely to fuel grievances on both sides.

An appeals court had already ruled that Philadelphia was justified in excluding Catholic Social Services, the foster-care group, from the roster of contractors the city used to place children in foster care; the city has rules that bar these contractors from discriminating on the basis of sexual orientation, and the Catholic group avowedly does that. But Chief Justice John G. Roberts Jr. — joined by the court’s liberals as well as Justices Brett M. Kavanaugh and Amy Coney Barrett — observed that the relevant anti-discrimination requirement had a caveat: A contractor is bound by those rules “unless an exemption is granted” by the relevant city officials.

The court assumed that a secular entity could have gotten an exception to discriminate if it had requested one (for what end? We don’t know: Perhaps to discriminate in the sense of placing gay children with same-sex families?). Because the Catholic charity did not get an exception, the court reasoned, it was unconstitutionally penalized. There’s a catch, though: There was no evidence that the city had ever made an exception to its policies regarding fostering by same-sex parents. No secular entity had been treated better than the Catholic charity. What the court concluded was that “discrimination,” as one of the lawyers arguing on Philadelphia’s side put it, was the “mere availability in the air” of differential treatment. It was an abstract possibility, not an actual practice.

Fulton is a compromise decision because the lawyers for the Catholic charity weren’t interested only in securing a victory for their client (which they achieved). They explicitly asked the court to also reject the governing precedent for free exercise claims. There they failed — but Justices Samuel A. Alito Jr., Neil M. Gorsuch and Clarence Thomas wrote in concurring opinions that they would have taken that route. Under current doctrine, embodied in a 1990 decision called Employment Division v. Smith, religious liberty is violated only when the state explicitly singles out religion for worse treatment than secular activities. Provided that laws are written in a general and neutral way, they pass muster. (In Smith, the court ruled that if Oregon banned the use of hallucinogenic drugs for everyone, it was not a violation of religious liberty that Native Americans could not use them in religious rituals.)

The problem is that the move that made Fulton possible — conjuring discrimination where none existed — opens the gate to new and divisive litigation against cities and states. These lawsuits will reduce the chance of sensible compromise on religious-liberties questions (and will corrode Fulton itself).

That’s because the kind of discrimination “in the air” that the court identifies is not hard to find. Indeed, it exists anytime a state or municipal official has discretion as to whether to enforce a rule — say, whether to fire a government employee for a sexist or homophobic comment, or whether to enforce a zoning or a public-health ordinance. Officials almost always have discretion not to enforce such rules. By the logic of Fulton, if such discretion exists, anytime officials chose to enforce a rule over a religious objection, they violate the Constitution. This is so even if (as in Philadelphia) they have a record of enforcing the rule against all secular comers.

One might have thought that cities and states could avoid this litigation morass by eliminating discretion and making rules mandatory for all. (Indeed, Alito suggested that if Philadelphia simply eliminates the language allowing officials to make exceptions, the dispute is back at Square One.) But last year, in a decision involving state aid to parochial schools, Roberts wrote a majority opinion saying that once a state had wrongfully discriminated by excluding religious groups from a scholarship program, it could not then fix the problem by eliminating the scholarships altogether. If that sort of “leveling down” is inconsistent with the Free Exercise Clause when it comes to state grants, it’s hard to see why it would be acceptable when it came to state contracts. At least where there’s a finding that a government violated the Constitution, therefore, doing away entirely with exceptions in the way Alito describes may not be an option.

Fulton also did not make clear where the exemptions granted to religious groups run out. Last year, the court held that religious schools are exempt, as a constitutional matter, from employment-discrimination law. (It broadened the “ministerial” exception to anti-discrimination laws by putting teachers in the same bucket as ministers — outside the law’s protections.) That case involved pregnancy and disability discrimination. But its logic might apply to race discrimination. Indeed, some commentators have argued that religious institutions can already engage in racial discrimination under the First Amendment’s shield. And Fulton goes out of its way to say that the protection of same-sex couples is a “weighty” interest — and nevertheless can be overcome by a religious interest claim. Why should race be different?

In a separate concurrence in Fulton, Barrett and Kavanaugh didn’t go as far as Alito, Gorsuch and Thomas, but they did indicate an openness for rethinking free exercise law, even as they joined the court’s majority. Collectively, the conservative justices’ opinions will encourage religious plaintiffs to keep trying to change the law. As Gorsuch says in his own concurrence, the question is bound to “recur tomorrow.”

It’s not hard to see where all that litigation ends: The Smith regime collapses under repeated challenges. At that point, the court would hold that the Constitution is violated anytime religion isn’t accommodated unless the state can make a showing of compelling necessity. The court has already rejected the idea that avoiding harm to third parties — including disfavored minority groups — counts as a necessary state interest. Hence, religious organizations will have the constitutional right to act on beliefs when doing so causes predictable, grave harm to others, including employees, patients and others.

In short, if the decision in Fulton v. Philadelphia is a compromise, it’s likely to be a volatile and fleeting one. It places municipal and state agencies in a difficult bind. It will invite much costly and divisive litigation. And rather than ending the culture war over religion’s role in the public sphere, it merely inaugurates what is likely to be a new, expensive and increasingly bitter chapter.