WASHINGTON — The U.S. Supreme Court reduced the wall of separation between church and state Monday in one of the most important rulings on religious rights in decades.

The decision could doom provisions in 39 states that prohibit spending tax dollars to support churches. The states defended the limits as necessary to keep the government from meddling in religious affairs.

Monday's ruling said Missouri was wrong to exclude Trinity Lutheran Church in Columbia, Missouri from a program intended to help non-profits cover their gravel playgrounds with a rubber surface made from recycled tires. The church wanted to improve the playground at its preschool and daycare center.

Faith & Freedom Coalition Chairman Ralph Reed speaks during a rally in front of the Supreme Court, on April 19, 2017 in Washington, as the court heard arguments in the Trinity Lutheran Church of Columbia v. Comer case. Mark Wilson / Getty Images file

The state rejected the application, citing a provision in the Missouri constitution that said "no money shall ever be taken from the treasury, directly or indirectly, in aid of any church, sect, or denomination of religion."

Lawyers for Trinity Lutheran argued that the state's denial of funds for the playground project violated the U.S. Constitution.

"This religious exclusion wrongfully sends a message that some children are less worthy of protection simply because they enjoy recreation on a playground owned by a church," said David Cortman of Alliance Defending, a conservative organization representing the church.

Related: Supreme Court Likely to Rule Against Missouri in Church-State Battle

Cortman argued that the government should be neutral toward religion. Blocking the church from a widely available public program, he said, "imposes special burdens on non-profit organizations with a religious identity" and amounted to hostility toward religion.

But Missouri had claimed that its constitutional provision did nothing to interfere with a church's religious activities. James Layton, the state's former solicitor general, said Trinity Lutheran "remains free, without any public subsidy, to worship, teach, pray, and practice any other aspect of its faith however it wishes. The state merely declines to offer financial support."

Layton said that while the U.S. Constitution prevents the government from prohibiting the free exercise of religion, "It does not guarantee churches opportunities for public financing."

Just before the case was argued in April, a statement from Missouri's newly elected governor, Eric Greitens, seemed likely to derail the legal battle. Reversing the state policy, he said religious organizations must now be permitted to apply for and be eligible for state grants. Their requests for state money would be "judged on the merits like any other applicant," he said.

The case attracted widespread attention among groups defending religious liberties. Some claimed that state bans like Missouri's were rooted in anti-Catholic bigotry and modeled after an effort by Rep. James G. Blaine, who unsuccessfully proposed a federal constitutional amendment in 1875 to ban government aid to churches.

A group representing Christian schools said a victory for Missouri could jeopardize government-funded loans to students who attend religiously affiliated colleges, including Brigham Young University, Georgetown, and Yeshiva University.