The legislation would allow the federal government to continue recognizing same-sex and interracial marriages in states where they were legally performed, should the court strike down Obergefell, a concern raised after the court ended the nationwide right to abortion in June.
The Respect for Marriage Act, which passed the U.S. Senate last week, was designed as a backstop to the 2015 Supreme Court ruling that legalized same-sex marriage nationwide, known as Obergefell v. Hodges.
A bipartisan amendment added in November affirmed that the bill would not subvert existing religious freedoms, helping quell initial opposition by conservatives. The bill, which was spearheaded by a group of Democratic and Republican Senators, gained the backing of several national religious groups.
The amendment's support from various religious groups that are theologically opposed to same-sex marriage reflects the fact that attitudes have changed, said Tim Schultz, the president of the 1st Amendment Partnership, which advocates for religious liberty.
"Fighting a permanent culture war over gay rights is not in their interest as religious organizations," he said. "They believe that seeking common ground is in the interest of religious freedom, the common good and how they portray their faith to the world."
Paul Brandeis Raushenbush, an American Baptist reverend and president of Interfaith Alliance, said the support for the bill from religious groups showed that many had undergone a "remarkable transformation" in the way they perceive same-sex marriage.
He attributed the shift partly to the fact that such marriages had ceased to be unusual in the United States since the Supreme Court legalized them.
"The sky didn't fall because same-sex marriage began happening," said Raushenbush, who is in a same-sex marriage himself. "The specter of same-sex couples getting married no longer feels scary because it's quite commonplace."
The legislation's vote comes the day after the Supreme Court appeared ready to rule that a Christian web designer has the right to refuse to provide services for same-sex marriages, in arguments challenging a Colorado law banning discrimination.