Indeed, the perception of homosexuality as abhorrent and sinful has textual roots in the Old and New Testaments, portions of which were also incorporated into the Quran. The most commonly cited examples, the eight so-called clobber passages, range from the admonition in Leviticus 18:22 (“Thou shalt not lie with mankind as with womankind; it is abomination”) to the declaration in Corinthians 6:9 that the “effeminate” are among the “unrighteous” who shall not inherit the kingdom of God.

Sex between men was called sodomy in a reference to God’s destruction of Sodom, and even consensual male intercourse was criminalized under the name sodomy. In 1986, when the Supreme Court upheld a sodomy statute in Georgia, Chief Justice Warren E. Burger noted in his concurring opinion that “condemnation of these practices is firmly rooted in Judeo-Christian moral and ethical standards.”

Yet as far back as 1964, representatives from Baptist, Quaker and Episcopalian congregations in San Francisco formed a Council on Religion and the Homosexual to bridge the chasm between gay people and churches. One year later, the city’s branch of the National Federation of Temple Sisterhoods called for consensual homosexual behavior to be decriminalized.

Such early steps led to more explicit efforts in the 1990s and 2000s by activists like Rabbi Yoel Kahn in Reform Judaism and Rabbi Steven Greenberg in Orthodox Judaism to formulate a textual basis for accepting gay identity, sexuality and marriage. In 2006, the Catholic theologian Daniel C. Maguire, a professor of religious ethics at Marquette University in Milwaukee, published a pamphlet, “A Catholic Defense of Same-Sex Marriage,” sending copies to 270 bishops.

“We have no moral right to declare marriage off limits to persons whom God has made gay,” Dr. Maguire wrote. “We have no right to say that marriage, with all of its advantages and beauty, is a reward for being heterosexual.”

In response, the Roman Catholic bishops of the United States denounced the pamphlet as “irresponsible” and “false teaching.” Across denominational lines in 2008, a leading Mormon theologian and former bishop, Dr. Robert A. Rees, was formally silenced for about a year by his local leader in the Church of Jesus Christ of Latter-day Saints, apparently for his consistent advocacy of compassion for gay and lesbian Mormons. The denomination was at the time campaigning for Proposition 8, the California ballot measure striking down same-sex marriage in the state.

Even so, theological dissidence has grown across the spectrum. Some scholars questioned whether the “clobber passages” referred to all homosexual activity or only to coerced sex or sexual rituals associated with idol worship. Many theologians asked why the condemnation of homosexuality should continue to be enforced when hardly any religious person today would follow the Bible’s injunction in Deuteronomy 21, for example, to stone to death a disobedient child. The American Muslim religious scholar Reza Aslan and a co-author, writing recently in Religion Dispatches, reminded their community of Islam’s commitment to care for “those who are persecuted.” Dr. Rees has cited the Mormon belief in the sacredness of family as consistent with the acceptance of same-sex marriages.