The American Civil Liberties Union recently joined with gay rights groups in withdrawing their support from a major piece of legislation aimed at ending workplace discrimination against gays and lesbians.

Why would gay rights advocates back out of a bill that fights anti-gay discrimination? Because the Employment Non-Discrimination Act also contains religious liberty protections.

"The provision in the current version of the Employment Non-Discrimination Act (ENDA) that allows religious organizations to discriminate based on sexual orientation and gender identity has long been a source of significant concern to us," reads the joint statement spearheaded by the ACLU. After the Supreme Court's Burwell v. Hobby Lobby decision, the activists continued, "it has become clear that the inclusion of this provision is no longer tenable."

Translation: These liberals think it might have been acceptable to allow churches to decline to ordain gay clergy, but if these protections are going to extend to private, for-profit companies like Hobby Lobby, there's too much potential for legal discrimination.

For two decades, ENDA has been near the top of the gay rights legislative agenda. (If you had told me in 1998 that gay marriage would be on the books in a critical mass of states before ENDA, I would have thought you were crazy.) And now the religious liberty provision is fracturing the coalition that has supported ENDA.

America has long carved out a special space for religious practice and conscience in its laws. The First Amendment of the Constitution protects the free exercise of religion, while the Civil Rights Act of 1964 bans most discrimination on the basis of religion, just as it forbids most discrimination based on race and sex.

Sexual orientation is increasingly joining these categories in enjoying protection under anti-discrimination laws. And this ENDA rift is just the latest episode demonstrating how easily religious and sexual identity can come into conflict.

Would a company that saw itself as informed by religious values — say, Hobby Lobby or Chick-fil-A — be discriminating or exercising religious freedom if it passed over a promising gay executive for its CEO position? Would a company like Mozilla be discriminating or promoting a culture of nondiscrimination if it effectively ousted a CEO over his (possibly faith-based) opposition to same-sex marriage?

What if the gay executive in question had never in the course of exercising his duties, as opposed to in his personal life, contradicted the company's stated values? What if the anti–gay marriage executive in question had never been accused of behaving in a discriminatory fashion, save for a personal political donation nobody in the company had even known about?

Obviously, the second example isn't a hypothetical. One could probably also find real-life examples of the first.

Interestingly, the law at the center of the Hobby Lobby case — the Religious Freedom Restoration Act — was passed only a year before ENDA was first introduced in Congress. Many people supported both laws. In theory, the two can be reconciled.

But in practice, many liberals voted for the religious freedom bill to protect the rights of religious minorities, not those of a conservative "moral majority." From this perspective it is easier to allow someone to follow their faith-shaped conscience on smoking peyote than in upholding traditionalist views on human sexuality (though these liberals would retort, with some justice, that peyote has less impact on third parties).

ENDA amended with expansive religious liberty protections is less sweeping than many state and local gay rights ordinances already in force. Like ObamaCare's contraceptive mandates, ENDA without such protections assumes a more crimped definition of religious liberty and practice than was until fairly recently the bipartisan national consensus.

There are two further complications. Many gay rights activists believe faith-based objections to homosexual practice are morally no different than racial hatred. Consequently, they believe the way government treats such objections should be legally no different than racism.

Similarly, many conservative Christians opposed gay rights legislation not to protect their own religious liberty but because they were trying to restigmatize homosexuality. They are only now fighting a rearguard action to protect their religious liberty because they have failed in the first effort.

One of these two approaches may turn out to be a costly miscalculation.