When President Obama came out in favor of gay marriage on May 9 — the first time an American president had made such a declaration — he electrified a long-roiling debate.

To gay-marriage supporters, the right to marry confers public acknowledgment that a same-sex union is normal and legitimate. It also serves as a protection to gay couples and their children.

To opponents, same-sex marriage is a violation of nature that goes against thousands of years of human history and, to some, signals a decline of civilization. For many opponents, it is an affront to God.

Then there’s the murky middle, people who may be evolving in their views, as Mr. Obama was until recently, but still aren’t sure where to land.

Obama’s public shift also shined a light on an apparent disconnect: growing public support for gay marriage even as legal barriers have grown around it. Support for same-sex marriage has risen substantially since 2003, when Massachusetts became the first state to legalize it. About half of Americans support it, up from about a third just 10 years ago, polls show.

But the advent of gay marriage in Massachusetts had another effect: Alarmed, conservative activists started putting the issue before voters. So far, they have succeeded in curbing it every time. Including North Carolina’s vote May 8, voters in 31 states have approved constitutional amendments against same-sex marriage; another 10 states have statutory bans. In six states — all in the Northeast except for Iowa — and the District of Columbia, gay marriage is legal. Others allow civil unions and other forms of domestic partnership.

The map is still sorting itself out. In November, voters in Maine and Minnesota, and likely Maryland and Washington — all states that voted for Obama in 2008 — will face ballot measures on gay marriage. With some, if not all, supporters of gay marriage have a shot at ending their losing streak. 

Rhode Island, which allows civil unions but not gay marriage, now recognizes gay marriages performed in other states. In the next few years, a few more states are expected to approve constitutional bans as others work to undo theirs. Hanging over this emerging patchwork is the US Supreme Court, with multiple cases heading to its doorstep.

Dizzying change

The pace of change has been dizzying. When Brian Powell, a sociologist at Indiana University in Bloomington, began interviewing Americans nationwide in 2003 for a book on attitudes toward gay marriage, discomfort with the topic was palpable.

“Many people would lower their voice when they would say the word ‘gay,’ as if they were talking about a disease,” says Mr. Powell, co-author of “Counted Out: Same-sex Relations and Americans’ Definitions of Family.”

By the last round of interviews, in 2010, the hushed tones had diminished. And more interviewees reported having a gay friend or relative. “How do you have an increase in gay relatives?” he says. “People had become more open.”

Powell also believes that, ironically, social conservatives helped remove the taboo around discussion of gay rights: All the advocacy to protect traditional marriage kept the issue in public consciousness, he says, making discussion more routine. 

The news media and the film and television industry have also been influential. Same-sex wedding announcements now appear regularly in newspapers. When Vice President Joe Biden revealed May 6 that he was “absolutely comfortable” with gay marriage — forcing Obama’s hand on the matter — he cited the influence of “Will & Grace.” The TV sitcom, which ran from 1998 to 2006, was about a straight woman and her gay best friend, but it did not involve gay marriage.

Still, “Will & Grace” paved the way for today’s “Modern Family,” the most popular show on TV, which includes a family headed by two men. Portrayals of gay relationships on TV are now so routine that the mainstream media almost yawn. 

Among social conservative activists, the news media and entertainment world are a big part of the problem — especially when it comes to the most striking result in polls: the generational split among Evangelicals. A survey last year by the Public Religion Research Institute found that 44 percent of white evangelical Millennials — those between ages 18 and 29 — favor allowing gays and lesbians to marry, compared with 19 percent of white Evangelicals overall.

Fighting the tide

Advocates for traditional marriage aren’t surprised.

“Three institutions very strongly promote acceptance of homosexuality: the education establishment — both higher ed and K through 12 — and also the news media and entertainment media,” says Peter Sprigg, a senior fellow for policy studies at the Family Research Council in Washington. “So I find when I talk to students, they’ve rarely ever heard the arguments against same-sex marriage. All they’ve ever grown up with is the arguments in favor. It’s difficult for them to overcome that conditioning.”

But Mr. Sprigg doesn’t believe young adults can’t come to a more conservative position on the matter. After all, he says, people get more conservative as they age. In addition, conservatives tend to have larger families, which over time could help shift public opinion. He also doesn’t buy the argument that federal recognition of gay marriage is inevitable. 

“Don’t underestimate the strength of the bulwark that social conservatives have put up through the passage of now-31 state constitutional amendments defining marriage as the union of one man and one woman,” Sprigg says. “The only way we’re likely to see same-sex marriage nationwide in the near future is if the US Supreme Court were to impose it, by declaring it to be a constitutional right.”

“I can’t rule out that possibility,” he adds, “but I’m cautiously optimistic that they will not do that.”

Still, an analysis of public opinion toward same-sex marriage shows the challenge conservatives face. Majorities in 16 states now support gay marriage, says Gregory B. Lewis, a public policy professor at the Andrew Young School of Policy Studies at Georgia State University in Atlanta. Even Massachusetts didn’t have majority support when the state’s Supreme Judicial Court ruled in 2003 for same-sex marriage. In 2011, Massachusetts topped the list with 67 percent support.

Support has risen in every state, Mr. Lewis reports — even Mississippi, which is at the bottom with 19 percent. But that’s up from 14 percent in 2004. In 2011 California, which voted against gay marriage four years ago via a measure known as Proposition 8, registered near the top nationally in its support of same-sex marriage, at 55 percent.

“It seems clear that if California were to redo Prop. 8, it would lose this time,” Lewis says.

Growing acceptance

For Stuart Gaffney and John Lewis (no relation) — a couple who married in San Francisco during a brief period in 2004 when gay marriages were allowed, then again in 2008 — the one consolation in the ongoing battle over Prop. 8 is that it did not retroactively invalidate their marriage.

Attitudes have changed, says Mr. Lewis, who recalls a nurse asking, “Who are you?” when he accompanied Mr. Gaffney and his mother to a hospital emergency room a decade ago. Today, the explanation would be much easier, he says. He also points to his 15-year-old niece in Chicago as a sign of how times have changed.

“It’s absolutely normal to her to have two uncles who are married,” Lewis says.

Kathy Bush and Mary Ritchie, too, have seen acceptance of same-sex relationships grow. The couple, living together in Framingham, Mass., since 1991 and married since 2004, have two sons, ages 11 and 13.

The women say they’ve experienced largely supportive relations with neighbors, co-workers, and other parents at school. Ms. Bush, a stay-at-home mom whose duties include providing shuttle service to baseball and soccer games, will head the parent-teacher organization at their sons’ middle school this fall. Ms. Ritchie, a state trooper, serves on a school council.

The two have also joined a legal battle to overturn the federal Defense of Marriage Act (DOMA), a 1996 law that defines marriage as between a man and a woman. Under federal law, Ritchie says, their marriage “means nothing,” noting that there are some 1,000 protections to which she and her family are not entitled.

Take federal taxes. Because they are not married in the eyes of Washington, they cannot file a joint return. The distinction has cost them some $35,000 in extra federal taxes since 2004, they say. “That’s a lot to us,” Bush says. That’s money that could go into a college fund for the boys, she says.

Another example: If Ritchie were to die in the line of duty, DOMA makes Bush ineligible for federal death and education benefits that would otherwise be available.

 Staff writers Gloria Goodale in Los Angeles and Mark Trumbull in Boston contributed to this report.

Leave a comment