From stories about faith motivating their public service to unequivocal promises to strip the tax exempt status of faith-based organizations that oppose same-sex marriage, Democratic presidential candidates talked religion at length Monday night as part of a series of interviews hosted by CNN and the Human Rights Campaign.

Dubbed the Equality Town Hall, the questions focused on how candidates would handle issues affecting L.G.B.T. Americans should they be elected president. Questions included how candidates would address H.I.V., housing for homeless L.G.B.T. youth and rights for transgender people in the workplace.

Dubbed the Equality Town Hall, the questions focused on how candidates would handle issues affecting L.G.B.T. Americans should they be elected president.

As the Supreme Court considers a pair of L.G.B.T. related cases that some religious leaders say could imperil religious freedoms, most candidates discussed how to balance faith protections with L.G.B.T. rights. While many candidates shared stories about their own faith, nearly all of them agreed that the federal government should penalize faith-based institutions that do not support L.G.B.T. rights.

Massachusetts Senator Elizabeth Warren pointed to her childhood faith in shaping her views on L.G.B.T. issues. She said the “basis” of her faith is “the preciousness of each and every life. It is about the worth of every human being.” She said that she could not remember a time when she opposed same-sex marriage. She joked that if a man believes marriage is the union of one man and one woman, she would tell him, “Then just marry one woman. I’m cool with that.”

Like the other Democrats running for president, Ms. Warren signaled her support for the Equality Act, a Congressional bill that would add sexual orientation and gender identity to existing federal civil rights protections. In more than half the states, it is legal to discriminate against L.G.B.T. in employment and housing. Some religious leaders, including the U.S. Conference of Catholic Bishops, have spoken out against the Equality Act, saying that it will harm religious freedom protections.

Asked about religious liberty, South Bend Mayor Pete Buttigieg said, “the right to religious freedom ends where religion is being used as an excuse to harm other people.”

Mr. Buttigieg, the only openly gay candidate seeking the Democratic nomination, used the town hall to talk about his own experience with faith. He said when Christianity is invoked to discriminate against L.G.B.T. people, “it makes God small.”

“If you belong to the Christian tradition that I belong to, then you believe that God loves you, and you look around and you notice that you’re gay, and those two things exist at the same time,” he said. “And I would also say that nothing has made me feel more connected, more able to be true, however imperfectly, to my faith than the experience of putting myself second, [and] that came with committing my life to my husband, Chasten.”

Senator Cory Booker, who speaks regularly on the campaign trail about his own faith, responded to a question about a Catholic high school teacher being fired for her marriage to another woman by saying it is possible to “respect your religious freedoms but also protect people from discrimination.”

Opponents of the Equality Act say it would whittle away existing religious liberty protections. Mr. Booker, who supports the measure, said he wanted to ensure that L.G.B.T. protections were explicit in education and healthcare. When asked if he would support stripping faith-based schools and colleges of their tax exempt status for discriminating against L.G.B.T. people, Mr. Booker said he would enforce federal non-discrimination laws, which could result in tax penalties.

Later in the evening, former Congressman Beto O’Rourke was asked a similar question—but he did not hold back.

Asked if he thought religious institutions, including colleges, schools and charities, should lose their tax-exempt status if they oppose same-sex marriage, Mr. O’Rourke responded, “Yes.” Later, in another question dealing with religion, he described himself as a lifelong Catholic. But he highlighted an incident when he served on the city council of El Paso, Texas, in which a Catholic priest chastised him during a meeting for supporting L.G.B.T. rights.

When asked about faith, Senator Amy Klobuchar of Minnesota said, “We can have different faiths in this country, but the law rules,” adding, “my church in Minnesota was the first open and affirming church in our state.”

A number of recent high-profile court cases have involved L.G.B.T. couples being refused adoption assistance by faith-based agencies. When asked about that, Ms. Klobuchar said adoption agencies should “follow the law.”

“There are so many loving gay, L.G.B.T.Q. couples that want to adopt kids, and we should make it easier and not harder,” she said.

Julian Castro, a former Obama administration official and former mayor of San Antonio, said he opposes disbursing federal money to faith-based groups that oppose L.G.B.T. rights.

“I don’t believe that anybody should be able to discriminate against you because you are a member of the LGBTQ community. I don’t believe that folks should be getting funding if they’re doing that,” Mr. Castro said.

Mr. Castro said that as a Catholic, he knows there are many L.G.B.T. people who also belong to religious traditions, adding it is time “to end this myth that these two things are separate.”

“The other side always acts like those two are completely separate,” he said, referring to Republicans. “They’re not. The L.G.B.T.Q. community includes people of faith who oftentimes, as I have heard over the years, have suffered through even with their faith, holding onto that faith, as the institutions that they belong to oftentimes have put them down, have characterized them as ‘the other.’”

“We can’t do anything about the religious institutions themselves, but when it comes to government funding or how our laws treat people, everybody’s going to be treated the same,” he said.

Though many of the candidates addressed similar topics, they were not all asked the same questions. Two candidates did not talk about faith or religious freedom specifically: California Senator Kamala Harris and businessman Tom Steyer. Former Vice President Joe Biden, who frequently invokes his Catholic faith, noted that Ireland, an historically Catholic country, was the first country to legalize same-sex marriage by popular vote.

Some religious Democrats expressed a mix of hope and disappointment with Thursday’s interviews.

“Buttigieg’s presence in the race affect the religious liberty debate in a powerful way. Simply by speaking as a gay Christian, he dismantles the assumption–held by many conservatives *and* liberals–that this is about choosing between support for religion or support for LGBTQ,” tweeted Amy Sullivan, a journalist who covers religion and politics. In a separate tweet, she wrote that Mr. O’Rourke “is not going to be the Democratic nominee and his statement last night is not going to be part of the Democratic platform.”

Michael Wear, a former Obama administration faith outreach advisor, told The Deseret News that candidates were too dismissive of faith during the interviews.

“If one of these candidates has the burden of governing this whole diverse, complex country, I would hope they wouldn’t be as flippant as they’re being during this campaign so far when it comes to that real stake that religious freedom has in these conversations,” he said.

The complexity of L.G.B.T. rights, faith and non-discrimination laws was perhaps most evident in a question posed by audience member Seth Owen. Mr. Owen made headlines in 2018 when he revealed that he had been kicked out of his home by his Southern Baptist parents because he is gay. Valedictorian of his high school, Mr. Owens wished to attend college but he could not afford it. So he set up an online fundraising page, which attracted the attention of celebrities including Ellen DeGeneres. He was eventually able to attend Georgetown University. The Jesuit school pitched in by reducing Mr. Owen’s out of pocket contribution to $0.

Correction: Oct. 15, 2019
A previous version of this article said Mr. Castro is a member of Congress. It has been updated to note he is the former mayor of San Antonio.