The landmark Supreme Court decision in Obergefell v. Hodges, which legalized same-sex marriage nationwide, may pose the biggest challenge yet to the tax-exempt status of religious institutions.

Religious institutions have a long lineage of being tax exempt, dating back to the Roman Empire. The federal revenue acts of 1909, 1913, and 1917 all exempted nonprofits--which includes places of worship--from the corporate excise and income taxes, and ever since, religious institutions have operated outside the purview of the IRS.

While the exemption has survived its fair share of slings and arrows, it has been a constant source of controversy. Most recently, on HBO's Last Week Tonight, where host John Oliver set out to demonstrate how easy it is to acquire the tax-free religious institution status by setting up his own church--Our Lady of Perpetual Exemption--to some hilarious results. But could one of the biggest hot-button issues of our time about to change all that?

The Supreme Court's decision to recognize same-sex marriages in the United States has raised a number of questions about how those weddings are accommodated or recognized, particularly by religious organizations.

The courts agree that the First Amendment gives churches the right to refuse to conduct religious ceremonies for same-sex partners if they conflict with their belief. For example, in Washington, DC, Maryland, New Hampshire, Rhode Island, and Washington, marriage counseling provided by churches can cater exclusively to heterosexual couples following the Supreme Court ruling. However, by exercising that First Amendment right, and refusing to recognize these unions, critics say churches-related organizations could be forfeiting their right to tax-free status.

There would seem to be some precedent. In 1976, Bob Jones University in South Carolina lost its tax exemption because its official policy was to expel any student who dated a person of another race. However, when the Supreme Court finally ruled on the case in 1983, it said the ruling applied "only with religious schools--not to churches or other purely religious institutions."

I spoke with Robin Fretwell Wilson, a professor of law at the University of Illinois who recently assisted the Utah Legislature to enact the Utah Compromise, balancing LGBT rights and religious liberty. In 2008 she co-edited "Same-Sex Marriage and Religious Liberty: Emerging Conflicts." She told me that this is a saga that's played itself out before, and a key lynchpin in protecting religious institutions' tax-free status is drawing a similar protection to the one that exist for other controversial topics such as abortion.

"When we were looking at emerging conflicts back [when I co-edited the book] in 2008, we looked at conscience clause cases when it came to abortion, and how reproductive rights advocates went after the tax exemption of a particular hospital. [They'd] say that because they were getting a pass on taxes, that they have to provide a particular service," Wilson explained. "If a business or institution receives some state-level funding, incentives or exemptions, private parties can make the case that the institution is a state actor. If you're a state actor, then under U.S. statutory law, you are not permitted to deprive someone of their Constitutional rights, hence the need to clarify the law."

It's a challenge that the Supreme Court seemed to acknowledge in its landmark decision on same-sex marriage. Justice Roberts wrote in his dissent: "Hard questions arise when people of faith exercise religion in ways that may be seen to conflict with the new right to same-sex marriage--when, for example, a religious college provides married student housing only to opposite-sex married couples, or a religious adoption agency declines to place children with same-sex married couples, suggesting there is little doubt that these and similar questions will soon be before this court."

However, despite the potential for fiery conflict, a number of religious institutions have been able to make this distinction between tax-exempt charity and state actor. Eleven of the 12 states that voluntarily adopted same-sex marriage agreed with Wilson and like-minded scholars that the tax-exempt status should be protected, because Wilson says, not doing so represents a slippery slope.

"When you get to the state-exemption question, that's really the state having this amazing power, because the value of that exemption is so great that they could easily force an institution into closing, or make them roll over and follow a different religious conviction than they otherwise do."

That hasn't stopped the drumbeat of a very vocal collection of dissenting opinions that believe religious institutions do serve a role as a state actor in society. Or even tax professionals who think that the IRS deciding what constitutes religion and what doesn't creates a very dangerous precedent that can no longer afford to exist.

Wherever the chips land in this debate, it's clear that the religious tax-exemption has plenty of detractors, and it's anything but a sure thing to continue.