The Indiana Religious Freedom Restoration Act of 2015 is constitutionally infirm and legally troublesome.

The circuitous constitutional route that brought about this statute began in 1990 when the Supreme Court ruled that the Free Exercise Clause of the First Amendment may not be used as a defense to violating the general laws of the land. In Employment Division v. Smith, a small group of Native Americans who had been fired from their jobs because drug tests revealed their use of peyote made applications for unemployment compensation, which the State of Oregon denied.

They appealed and claimed that their use of peyote, a hallucinogenic drug, could not be the basis for firing them from their jobs because it was a sacrament in their religion. The court ruled that the adherents to this religion had the same obligation to obey the laws that prohibit the use of peyote as all persons do.

In response to that decision, and wanting to show an interest in an issue of constitutional liberty for a change, Congress enacted the federal Religious Freedom Restoration Act of 1993 (RFRA), a clumsy effort to overturn the Employment Division v. Smith ruling.

That statute basically required the federal government and the states to permit the “my religion made me do it” defense . . .

That statute basically required the federal government and the states to permit the “my religion made me do it” defense wherever there was an arguable claim that a general law of the land conflicted with a genuine religious practice or belief. The statute also mandated an exacting due process standard, called strict scrutiny, that the courts are to apply to the states’ enforcement of their laws when addressing an alleged clash between a general law applicable to everyone and a free exercise of religion claim.

That statute basically required the federal government and the states to permit the “my religion made me do it” defense . . .

Four years later, when the Roman Catholic Archbishop of San Antonio, Texas, claimed the protection of RFRA to justify an exemption to a local zoning law so that an old church could be expanded, and lost, he appealed, and the case made its way to the Supreme Court. In Boerne v. Flores (1997), the court found RFRA to be unconstitutional. It ruled that Congress had effectively redefined the meaning of the Free Exercise Clause and mandated the judicial standards to be used when assessing claims made under it, and that that definition and mandate are not properly Congress’ to make. Because Congress’ powers under the Fourteenth Amendment are limited to remedying state failures to protect fundamental liberties and do not extend to defining the meaning or parameters of constitutional provisions, the court invalidated RFRA.

Thus, it is clear that one may not violate any law, state or federal, and escape the consequences of that violation on the basis that one’s religious views compelled the disobedience. Were this not the case, then nothing would prevent animal sacrifice, the use of mind-altering drugs, and even racial or gender or national origin discrimination in public accommodations and housing -- all allegedly based on one’s claimed religious views. The federal Civil Rights Act of 1964 prohibits discrimination in housing and public accommodations based upon race, gender, religion, beliefs or national origin, and quite properly permits no religious-based defense.

In response to the invalidation of RFRA, many states enacted their own form of RFRA, and most states added sexual orientation to the litany of prohibited bases for discrimination in public accommodations and housing. Indiana has not added the prohibition on discrimination based on sexual orientation; yet its own RFRA statute, signed into law last week, provides a "my religion made me do it" defense to allegations of discrimination based on sexual orientation. Hence the belief and fear that the Indiana statute is an affirmative attempt to provide a lawful basis for such discrimination. Such an attempt would surely run afoul of the Supreme Court’s invalidation of a Colorado constitutional provision that purported to do the same in Romer v. Evans (1996).

The legal issues attendant upon the judicial enforcement of this Indiana statute are enormously complex. They would amount to judges determining the centrality and sincerity of a person’s claimed religious practices to the core teachings of his religion. This type of determination by judges could only come about by an inquiry unknown in American jurisprudence (“Is this really taught by your church?” “Do you really believe this?” “How is your refusal to sell goods or services to this person central to your religious beliefs?”) and prohibited by the Free Exercise Clause, which the courts have held bars such judicial inquiries.

In the days before the federal Civil Rights Act of 1964, the late Sen. Barry Goldwater offered a neutral, non-racist common-law argument based on morality and property rights against that landmark legislation. He articulated the view that a seller of goods or services or real estate has a natural right to decide to whom he wishes to sell, free from government commands.

Goldwater paraphrased Thomas Jefferson, who argued that the only moral commercial transaction is one truly voluntary on the part of the buyer and the seller. That argument has an attractive leave-me-alone appeal to it; yet, the public policy of the nation since 1964 has unambiguously rejected it. Today in America, if you operate a public accommodation or deal in real estate, you cannot choose your customers; they choose you. This Indiana statute is arguably an effort to bring back the pre-1964 days with respect to sexual orientation.

Because discrimination based on sexual orientation is not prohibited by the Civil Rights Act of 1964, Indiana and all other states are free to prohibit it or to look the other way in the face of it. But they are not free to encourage it or to make it lawful.

Andrew P. Napolitano, a former judge of the Superior Court of New Jersey, is the senior judicial analyst at Fox News Channel.