The vote was 6 to 3, with Chief Justice John Roberts Jr. writing for the majority and the court's three liberals in dissent.
It was the latest case in which the court came down on the side of religious interests when weighing the Constitution's protection of religious exercise against its prohibition of government endorsement of religion.
The case involves an unusual program in a small state that affects only a few thousand students. But it could have greater implications as the more conservative court relaxes the line between church and state.
Under the program, jurisdictions in rural areas too sparsely populated to support secondary schools of their own can arrange to have nearby schools teach their school-age children, or the state will pay tuition to parents to send their kids to private schools. But those schools must be nonsectarian, meaning they cannot promote a faith or belief system or teach "through the lens of this faith," in the words of the state's department of education.
Roberts said that program could not survive the Constitution's guarantee of free exercise of religion.
"There is nothing neutral about Maine's program," he wrote. "The State pays tuition for certain students at private schools - so long as the schools are not religious. That is discrimination against religion."
Justice Sonia Sotomayor, one of the dissenters, answered, "This Court continues to dismantle the wall of separation between church and state."
Roberts was joined by fellow conservative Justices Clarence Thomas, Samuel Alito Jr., Neil Gorsuch, Brett Kavanaugh and Amy Coney Barrett.
The decision was an example of how Roberts prefers to move the law incrementally in a conservative direction. In 2017, he wrote the opinion that said a state could not exclude a church playground from a program that provided funding for safety measures.
In 2020, he wrote for the majority that a Montana program that provided tax credits to donors who sponsored scholarships for private school tuition must be open to private religious schools, as well.
"A state need not subsidize private education," he wrote. "But once a state decides to do so, it cannot disqualify some private schools solely because they are religious."
Roberts wrote in Tuesday's ruling, "Maine's decision to continue excluding religious schools from its tuition assistance program ... promotes stricter separation of church and state than the Federal Constitution requires."
The court's three liberals - Justices Stephen G. Breyer, Elena Kagan and Sotomayor - said the Maine case went too far.
Sotomayor noted the trajectory. "What a difference five years makes," she wrote, "In 2017, I feared that the Court was 'lead[ing] us ... to a place where separation of church and state is a constitutional slogan, not a constitutional commitment.' Today, the Court leads us to a place where separation of church and state becomes a constitutional violation."
Breyer, in a separate dissent joined by Sotomayor and Kagan, said that the court in the past has agreed states may provide assistance to private religious schools.
"But the key word is may," Breyer wrote. "We have never previously held what the Court holds today, namely, that a State must (not may) use state funds to pay for religious education as part of a tuition program designed to ensure the provision of free statewide public school education."
The case involved two families who lived in a rural part of Maine that did not offer public secondary schools. David and Amy Carson wanted the state's tuition payments to continue sending their daughter to Bangor Christian Schools, and Troy and Angela Nelson, who wanted to send their daughter to Temple Academy. They were represented by conservative and libertarian legal groups including the Institute for Justice.
A panel of the U.S. Court of Appeals for the 1st Circuit, which included retired Justice David Souter, said Maine was within its rights not to spend public funds on schools with a religious mission.
Notre Dame law professor Nicole Stelle Garnett, who filed a lawsuit against Maine's program 25 years ago, called the decision a "victory both for religious liberty and for American schoolchildren."
She said in a statement that the decision "clears away a major hurdle to the expansion of parental choice in the U.S. by clarifying that, when states adopt choice programs, they must permit parents to choose faith-based schools for their children."
On the other side, Americans United for Separation of Church and State President and CEO Rachel Laser said in a statement that "the ultra-conservative majority of the U.S. Supreme Court continues to redefine the constitutional promise of religious freedom for all as religious privilege for a select few."
The case is Carson v. Makin.