(Bloomberg) -- When the US Supreme Court legalized same-sex marriage back in 2015, almost half of Americans didn’t support the decision and more than two dozen states had laws on the books banning the practice.

Now, less than a decade later, the Senate has passed a rare bipartisan bill that would provide federal recognition for same-sex marriages, a move that Gallup polling finds more than 70% of US adults favor. The vote represents one of the biggest shifts in both legislative support and public opinion on an issue in recent years. 

The legislation repeals the 1996 Defense of Marriage Act, a federal law that defined marriage as between a man and a woman. The bill, which still has to go back to the House of Representatives for final passage, doesn’t immediately change anything for same-sex couples in the US. But it does protect marriage equality in case the court overturns its precedent — a ruling Justice Clarence Thomas has suggested the court review — which would have allowed states to make their own rules.

“It became really clear to us that having won legislation in some states and having won in the Supreme Court was not enough,” said Kasey Suffredini, vice president of advocacy and government affairs at the Trevor Project, an LGBTQ youth suicide prevention group. “We actually needed Congress to go on record.”

The law would still allow states to refuse to issue same-sex marriage licenses, but they would have to recognize those provided by other states. 

Twelve GOP senators, including co-sponsor Susan Collins of Maine, joined 49 Democrats in voting for the Respect for Marriage Act. While the views of Americans of all party affiliations have shifted in support of same-sex marriage, only in recent years have a majority of Republicans been in favor of marriage equality, with young people driving the shift. A Pew Research Center survey from October found that 64% of Republicans ages 18 to 29 say legalizing same-sex marriage is “good for society” compared with 30% of Republicans over the age of 65.

“The American people rightly expect their elected representatives to bring our laws in line with our beliefs,” said Republican Senator Rob Portman of Ohio this week. 

Thirty-six Republicans voted against the bill. “It’s a disservice to all Americans if we elevate the rights of one group at the expense of another,” said Senator Mike Lee of Utah.

Lee and others opposed the legislation on religious grounds, despite an amendment offering religious liberty protections. Republican Senator James Lankford of Oklahoma said the bill would “put the issue of religious liberty at risk for millions of Americans.”

While most Evangelical Christians strongly oppose same-sex marriage, even that’s shifting among younger generations. And Americans of other religious affiliations have drastically changed their attitudes. Almost 70% of Catholic Americans support same-sex marriage, up from 49% a decade ago. Earlier this month, the Church of Jesus Christ of Latter-day Saints released a statement supporting the bill. (Utah Senator Mitt Romney, a mormon, was one of the dozen Republicans who voted for the bill Tuesday.) 

No Magic

This dramatic shift in attitudes and laws “didn’t just happen by magic,” said Evan Wolfson, founder of Freedom to Marry, which lobbied for marriage equality for more than a decade before the US Supreme Court legalized it. “It was a product of organizing and work and persuasion and battling.” 

Not that long ago, even the bluest states denied same-sex couples the right to marry and few Democratic legislators supported the issue. President Bill Clinton, a Democrat, signed the Defense of Marriage Act into law in 1996 and Barack Obama in his 2008 campaign said he opposed marriage equality “as a Christian.”

It wasn’t until 2004 that Massachusetts became the first state to legalize same-sex marriage after a court ruling. Others didn’t follow. Instead, came a backlash: Almost a dozen states passed amendments banning same-sex marriage that year.

In response, LGTBQ advocacy groups, including the American Civil Liberties Union, the Human Rights Campaign and Freedom to Marry, created a roadmap to legalization across the US by 2030. The 2005 plan was called “Winning Marriage: What We Need to Do.” 

Part of the strategy involved public education for the “movable middle” — Americans whose attitudes on the issue might change. To do that, these groups found high-profile spokespeople to raise the visibility of same-sex marriage. Celebrities like Larry King and David Hasselhoff were tapped to appear in PSAs. Advocates also enlisted volunteers and registered voters to support same-sex ballot measures. In the span of 11 years, the coalition invested at least $153 million in these efforts. 

Over the next decade, through a series of court decisions, state laws, and referendums, more states recognized same-sex marriages. By 2012, Obama became the first sitting US president to support the issue, saying his views had “evolved.” That year, 100 organizations lobbied members of Congress for a precursor to the bill the Senate passed this week. That campaign included a video with then-Secretary of State Hillary Clinton announcing her support for the issue, which was viewed 24 million times.

In 2013, the Supreme Court ruled a crucial part of DOMA as unconstitutional. By 2014, a majority of US states were allowing the unions. Then, in 2015, the court legalized the practice nationwide in Obergefell v. Hodges, which determined that the right to marry is guaranteed to same-sex couples by the US constitution. 

“There were battles after battles, messengers after messengers, victories after victories,” Wolfson said.

Far Enough?

Legal and political battles over same-sex unions aren’t going away. In December, the Supreme Court is hearing arguments in a case about a Colorado website designer who says she won’t create pages for same-sex weddings. The designer, Lorie Smith, contends Colorado is violating her First Amendment free speech rights. Smith is seeking an exemption from Colorado’s anti-discrimination law, which includes protections for LGBTQ people.

And despite broad acceptance for marriage equality, LGBTQ people in the US still face widespread discrimination and hostility. Hateful rhetoric and violent attacks against the community, including a recent shooting at a Colorado nightclub that killed five people, have been on the rise in recent years. There was a fourfold increase in anti-LGBTQ demonstrations and violence between 2020 and 2021. 

Focus has shifted away from marriage to anti-trans rhetoric and laws. Conservative politicians have proposed and passed a record number of anti-LGBTQ bills, many focused on limiting trans-related health care and how transgender students can participate in school sports. During the midterm elections Republican hopefuls amped up anti-trans messaging and this year alone there have been at least 124 threats against drag events. 

Read more: Anti-Trans Health Care Laws Are the Latest Republican Target

The Respect for Marriage Act doesn’t address these issues, said Imara Jones, founder of TransLash Media, a nonprofit organization and digital community. “This is not what’s going to be an antidote at this moment,” Jones said.

She’s calling on Congress to pass the Equality Act, which would ban discrimination based on sexual orientation and gender identity. A May Pew survey found 64% of respondents said they favored protecting transgender people from discrimination in jobs, housing and other settings.

While the bill got some Republican votes in the House of Representatives, the GOP Senators who helped pass marriage equality have yet to support the law.

©2022 Bloomberg L.P.