The Supreme Court’s conservative justices appeared inclined to endorse a Montana program that provided tax incentives to those who fund scholarships for families to use at religious schools.

While liberal Justice Sonia Sotomayor warned at Wednesday’s oral argument that it would be a “radical” departure for the court, her ideological counterparts said excluding religious institutions from government programs open to others could amount to unconstitutional discrimination.

The outcome and breadth of the decision seem to depend on Chief Justice John G. Roberts Jr., who generally has been part of the court’s modern movement to loosen the rules regarding church and state separations. He usually prefers the court to move in incremental ways.

Roberts, 64, took the bench less than eight hours after presiding over a marathon session of the Senate impeachment trial of President Trump. He made no mention of his double duties, but the court acknowledged it scheduled only one oral argument Wednesday in anticipation of his Senate service.

The importance of the case was underscored by the number of people who camped out in freezing temperatures on the Supreme Court’s sidewalk to get inside. The lucky ones joined Education Secretary Betsy DeVos, who has made including religious schools in school choice programs a priority and who sat in the front row.

At issue was an initiative passed by the Montana legislature in 2015 that provided dollar-for-dollar tax credits up to $150 to those who donated to scholarship programs for low-income parents to send their children to private schools.

The program made no distinction as to whether parents could use the scholarships at religious or secular schools. About 70 percent of private schools in the state are religious.

The Montana Supreme Court said that ran counter to a state constitutional prohibition against using public funds for religious institutions and schools. Instead of saying the program could fund only secular schools, it struck down the tax credit program.

“The only reason the court invalidated the program was because it included religious schools,” said Richard B. Komer, who was representing the parents on behalf of the libertarian Institute for Justice. He said that ruling singled out religious parents and violated the U.S. Constitution’s protection of the free exercise of religion.

But liberal justices defended the Montana Supreme Court’s action to level down (getting rid of the program) rather than level up (making it available for use at all schools).

Justice Ruth Bader Ginsburg questioned whether the parents even had standing to bring the case, because they were being treated no differently from parents who sent their children to secular private schools.

“Where is the harm?” she asked.

Justice Elena Kagan picked up on that. “Because of the [Montana] Supreme Court’s ruling, whether you go to a religious school or you go to a secular private school, you’re in the same boat at this point,” she said, adding, “There is no discrimination at this point going on, is there?”

Sotomayor wondered about the extent of Komer’s argument. “Are you saying that states are forced to give money both to secular and religious schools?” she asked.

Komer noted the money was given to parents who made the choice of school. But he added, “If they give to one [family], they must give to the other.” He said the Montana court’s remedy of striking the entire program did not shield it from charges of discriminating against parents who favored religious schools.

The high court in 2017 said Missouri could not ban a church school from requesting a grant from a state program that rehabilitated playgrounds. Kagan and fellow liberal Justice Stephen G. Breyer joined that decision, but indicated Wednesday that religious education was different.

Breyer noted the Constitution’s prohibition on government establishment of religion. “There is nothing more religious, except perhaps for the service in the church itself, than religious education,” Breyer said. “That’s how we create a future for our religion.”

Breyer was reacting in part to the argument of Deputy Solicitor General Jeffrey B. Wall; the Trump administration is supporting the parents.

“If the Montana Supreme Court had invalidated this program because it included historically African American schools or all-girl schools, that would be a straightforward equal-protection violation,” Wall said. “Nothing about it would be cured by the fact that other parents had been denied funding as well.”

Justice Samuel A. Alito Jr. and Roberts pressed Adam G. Unikowsky, the lawyer representing the state, on that issue.

Cities might be within their rights to close municipal swimming pools, Roberts noted, but not because too many African Americans were using them.

Alito added: “Basically what you’re saying is, the difference between this and race is, it’s permissible to discriminate on the basis of religion. It’s not permissible, ever, to discriminate on the basis of race. That’s what you’re saying.”

Unikowsky replied that there could be acceptable reasons for states to avoid funding religious organizations. When delegates to a 1972 rewriting of Montana’s Constitution retained the state’s “no-aid clause,” the concern was that “if you have money going to religious schools, that’s going to lead to entanglement problems. And the way to solve that problem is to have a structural provision saying, we’re not going to do it.”

Justice Brett M. Kavanaugh, who has spoken extensively about his Catholic upbringing and coaching basketball at his daughters’ parochial school, said those constitutional amendments have a notorious past.

Provisions known as Blaine Amendments — the 19th-century amendments that prohibit public funding of religious organizations and are found in 38 state constitutions — are “certainly rooted in grotesque religious bigotry against Catholics,” Kavanaugh said.

“That was the clear motivation for this,” he added.

“That’s not true,” Unikowsky replied. “In the 1972 Constitution, which is where this provision was enacted, I don’t think there’s any evidence whatsoever of any anti-religious bigotry.”

Kagan said it was easy to think of reasons aside from bigotry that a state would want such a provision.

“You might actually think that funding religion imposes costs and burdens on religious institutions themselves,” Kagan said. “You might think that taxpayers have conscientious objections to funding religion. You might think that funding religion creates divisiveness and conflict within a society, and that for all those reasons, funding religious activity is not a good idea, and that you would rather level down and fund no comparable activity, whether religious or otherwise, than fund both.”

The case is Espinoza v. Montana Department of Revenue.