The Supreme Court’s newest look at the separation of church and state focused Wednesday on the hard and unforgiving surface of a church preschool’s playground in Missouri.

Trinity Lutheran Church in Columbia, Mo., wanted to participate in a state program that reimburses the cost of rubberizing the surface of playgrounds. But the state said that was not allowed. The exclusion has raised big questions about how to uphold the Constitution’s prohibition on government support for religion without discriminating against those who are religious.

“It’s a fraught issue. It’s a hard issue,” said Justice Elena Kagan, adding, “It’s an issue on which I — I guess I’m going to say nobody is completely sure that they have it right.”

[Court agrees to hear church playground case with larger implications]

Kagan and other justices across the court’s ideological spectrum indicated that they believed Missouri might have gone too far in excluding Trinity Lutheran. The court’s ultimate decision in the case could have wide-ranging implications for government aid to religious institutions.

Missouri’s state constitution, similar to those of about three dozen states, directs that “no money shall ever be taken from the public treasury, directly or indirectly, in aid of any church, sect, or denomination of religion.”

David A. Cortman, a lawyer for the conservative group Alliance Defending Freedom, representing the church, acknowledged the difficulty religious cases raise but said this one should be easier for the justices than most.

“All we’re talking about is . . . a safer surface on the playground for when kids play,” Cortman told the court, adding, “That doesn’t enable any religious activity.”

But James R. Layton, a Jefferson City lawyer representing the state, said that no matter where the line is drawn on the separation of church and state, “writing a check that says ‘payable to Trinity Lutheran Church’ ought to be on the other side of the line.”

Layton seemed to face an uphill battle in defending the exclusion of church groups from a program with only a secular goal — making playgrounds safer — and for which Trinity’s Learning Center would have been approved had it been a secular preschool.

Kagan challenged him. “You’re depriving one set of actors from being able to compete in the same way everybody else can compete, because of their religious identification,” she said. In such a case, she said, the state’s interests “have to rise to an extremely high level.”

Kagan asked tough questions of Cortman as well. But the court already has a conservative majority — likely to include the newest justice, Neil M. Gorsuch — that is protective of religious plaintiffs. Sympathetic comments from Kagan and Justice Stephen G. Breyer, her fellow liberal, bode well for the church.

[George Will: When separation of church and state leads to children with scraped knees]

The hour-long argument suggested there could be a majority for a narrow ruling in favor of churches when programs are generally applicable to the public and secure secular benefits promoting, for instance, health and safety. Some states with constitutional restrictions like Missouri’s allow such participation.

And — adding a twist to the case — Missouri now does as well. The state’s new Republican governor, Eric Greitens, announced last week that he was reversing the policy that denied Trinity’s application in 2012 and that churches are now eligible to participate.

The state’s new attorney general agrees, and Layton was appointed by the state to defend its old policy. Several justices asked why that did not make the case moot.

Certainly if the new policy had been in place it would have affected the court’s decision to review the case, Justice Ruth Bader Ginsburg said.

But Cortman and Layton argued that the court should decide the issue, because the policy could be changed again in the future. Justices spent little time on that issue and more on the merits of the arguments.

The backdrop for the case was a 2004 Supreme Court decision, Locke v. Davey, that said Washington state’s college scholarship program could deny those who wanted to major in theology.

Cortman and some of the conservative justices said that was different because a theology degree was obviously more closely tied to religious practice.

[Gorsuch jumps right in]

Chief Justice John G. Roberts Jr. had tough questions for Layton, and Justice Samuel A. Alito Jr. pointed out a number of federal programs that allowed government funding for safety and protection of churches, synagogues and mosques.

Another oddity of the case is that the court accepted it in January 2016, before the death of Justice Antonin Scalia. The court delayed scheduling it until now, when it has a full roster of justices, perhaps to avoid a tie

Gorsuch asked few questions Wednesday. He did volunteer that everyone in the case agrees that the church was subject to discrimination by being told it could not participate in the program, which reimburses those that resurface their playgrounds through a state program that recycles old tires.

Justices Ginsburg and Sonia Sotomayor were Cortman’s toughest questioners.

Sotomayor took exception to Cortman’s argument that Missouri’s program interfered with the right to free religious exercise.

“We seem to be confusing money with religious practice. I don’t think the two are tied,” she said. “This church is not going to close its religious practices or its doors because its playground doesn’t have these tires.”

Missouri and the majority of states restrict the use of tax money for religious institutions, Sotomayor said. “They’re just saying, ‘We don’t want to be involved with the church,’ ” she said.

Ginsburg noted that Trinity said it does not discriminate among the students it accepts. But, she asked, what about a theoretical case in which a church school favored Lutherans, then other Protestants, then perhaps allowed in Jews or others as space permitted? Should public money go for such a church?

Cortman replied that he believed Trinity should be included in the grant program even if it restricted its school population to Lutherans.

Breyer pressed Layton on why it was proper for Missouri to provide religious institutions with some services but not others.

“Does the Constitution of the United States permit a state or a city to say, we give everybody in this city police protection but not churches?” Breyer asked. “We give everybody fire protection, but let the church burn down. We give everybody public health protection, but not a church.”

Layton said he would be reluctant to make such a claim. But he said there were differences.

“One is that we are not actually taking money from the state treasury and giving it to the church,” Layton said. “And this court has seldom, if ever, actually said it’s okay to write a check from the public treasury to a church. . . . We’re providing a service. And the service there is not being provided solely for the benefit of the church. The service is being provided for police and fire for the benefit of the public safety.”

The case is Trinity Lutheran Church of Columbia v. Comer.