(CNN) At CNN's Equality Town Hall focused on LGBTQ issues and co-hosted by the Human Rights Campaign, 2020 Democratic presidential candidate Beto O'Rourke was asked by CNN's Don Lemon if he thought "religious institutions like colleges, churches, charities, should they lose their tax-exempt status if they oppose same-sex marriage?"

"Yes," O'Rourke replied, adding that "there can be no reward, no benefit, no tax break for anyone or any institution, any organization in America that denies the full human rights and the full civil rights of every single one of us."

Facts First: Legal precedent is pretty clear in determining that denying tax-exempt status based on a group's viewpoint would be in violation of the First Amendment.

Beto's explanation

In response to whether O'Rourke believes his plan would be constitutional, Aleigha Cavalier, O'Rourke's national press secretary, told CNN that "Beto was referring to religious institutions who take discriminatory action."

If O'Rourke was not referring to viewpoint discrimination but rather to discriminatory action as his campaign says, there is legal precedent for organizations to lose their tax-exempt status if they engage in such actions.

Camilla Taylor, director of constitutional litigation for Lambda Legal, one of the oldest organizations focused on LGBT rights, told CNN "In the past, the Supreme Court upheld the IRS when they issued a revenue ruling that educational institutions that discriminate on race do not qualify as charitable institutions given that they are acting contrary to public policy."

"My reading is that Beto feels it would be consistent to treat LGBT discrimination in the same way," Taylor said.

First Amendment issues

Lemon's question, however, was whether O'Rourke would be in favor of denying tax-exempt status if a religious organization "opposed same sex marriage," not if they took broader discriminatory action. This left many wondering if such a move would violate the constitution.

"It's open and shut," Eugene Volokh, a professor at UCLA School of Law and First Amendment expert, told CNN. "Everything old is new again. In the 1950s, various governments tried to do that -- they were going after supposed communists."

Volokh pointed to the 1958 Supreme Court case Speiser v. Randall over California's decision to require applicants for certain tax exemptions to sign a loyalty oath to the US and the State of California. The Court ruled that California could not impose the oath and in the opinion, progressive Justice William Brennan wrote that "a discriminatory denial of a tax exemption for engaging in speech is a limitation on free speech."

"The court made clear that if you deny a tax exemption it's the same as a fine," Volokh said. "So, one question you might ask is, would it be permissible to say we're going to impose a fine on any group or any religious group that takes a particular view about same-sex marriage? The answer is of course not. Clearly it would be a First Amendment violation."

Courts have reaffirmed this time and again . More recently, in a 2015 DC Circuit Court of Appeals case over the IRS denying certain tax exemptions for a pro-Israel organization, the court found that "in administering the tax code, the IRS may not discriminate on the basis of viewpoint."

In 2017, Volokh notes, the Supreme Court unanimously ruled that the government could not reject trademark applications that were seen as disparaging because it would be viewpoint discrimination.

"Even when it comes to these kinds of fairly modest government provided benefits (e.g. certain trademark protections) the government can't discriminate based on viewpoint," Volokh said.

Asked the same question earlier in the night, New Jersey Sen. Cory Booker gave a much more dissembling answer, a seeming acknowledgment of the tricky constitutional issues involved in removing a group's tax-exempt status on the basis of views or beliefs. While Booker said he would "press this issue" and conceded that it would be a "long legal battle," he ultimately did not give a definitive answer.

This is not the first time O'Rourke's statements have tested the bounds of what is constitutional. His proposal to impose a mandatory confiscation of AR-15 and AK-47 type rifles would most certainly run into trouble in the courts and would likely be struck down in the Supreme Court.