Gay rights groups and their allies were outraged when Indiana enacted a "religious freedom" measure that let businesses refuse to take part in same-sex weddings and other events they find objectionable. Opponents of the new law had an unassailable goal: protecting a small group of people from having their freedom trampled by an unsympathetic majority.

Funny thing: That's exactly what religious freedom laws were designed to do.

These laws have gotten a bad name from Indiana -- where the legislature didn't place a high priority on such liberty until gay marriage arrived. But they have an honorable pedigree and considerable value. Their point is not to promote mistreatment, but to prevent it.

Consider some of the individuals and groups that have needed relief from oppressive demands: a Muslim prison inmate who felt obligated to grow a beard; an Apache leader whose eagle feathers, needed for sacred ceremonies, were confiscated; Jewish soldiers whose yarmulkes violated military dress codes.

In each case, general rules were adjusted or waived because they inflicted a special injury on particular religious groups -- and because the religious needs could be accommodated without noticeable harm.

But in 1990, the Supreme Court turned a deaf ear to such concerns. It rejected the free exercise claims of two Native Americans who lost their drug counseling jobs for using peyote, an illegal drug, in a religious sacrament.

Congress responded by passing the Religious Freedom Restoration Act. It had the enthusiastic support of such liberal stalwarts as Sen. Edward Kennedy, D-Mass., and then-Rep. Charles Schumer, D-N.Y., as well as the American Civil Liberties Union. State versions followed after the Supreme Court said RFRA applied only to the federal government.

But the nature of these laws raises the obvious question: Why should religious people get more latitude than nonreligious ones?

One reason is our constitutional framework. The First Amendment treats religious practices as different from other human activities. In matters of the spirit, the government is supposed to be neutral: It may not restrict religious beliefs or practices, and it may not promote or subsidize them.

For a long time, the Supreme Court took the free exercise of religion to mean that believers should sometimes be excused from requirements applied to everyone else. This fit the constitutional notion of neutrality: Just as the government shouldn't reward citizens for embracing religion, it shouldn't penalize them, intentionally or otherwise.

So the Amish were allowed to keep their children out of school after eighth grade. A Seventh-day Adventist was granted unemployment benefits after losing her job for refusing to work on Saturday, her Sabbath. A Jehovah's Witness who quit his job rather than work in a factory making military weapons was also entitled to unemployment insurance.

Why should the Seventh-day Adventists be spared from working on Saturday while Methodists and atheists have no choice? One reason lies in our constitutional tradition, which gives higher priority to the demands of faith.

Another, though, is that religious obligations are different from other demands. It's one thing to incur the disapproval of your husband, wife or children by going to work on Saturday. It's a bit worse to incur the wrath of an all-powerful God.

To the nonreligious, like me, such fears may look silly. To the believer, they involve the highest possible stakes. "It is no more reasonable to expect serious believers not to act on their understanding of God's will than to expect gays and lesbians to remain celibate for life," says Douglas Laycock, a law professor at the University of Virginia.

Besides, this policy extends beyond the devout. You don't have to believe in God to be exempted from military service as a conscientious objector. You don't need religious reasons for regarding abortion as murder to be free to refuse to assist in one. Some secular demands of conscience are just as compelling as faith-based ones.

Nor is the protection absolute or automatic. Those with a religious objection to a law may ask to be exempted. But when the cost of accommodating that objection is too high -- say, allowing racial discrimination or harming children -- the objections will be overruled.

Religious liberty, it's fair to say, should not be grounds for stigmatizing and ostracizing people because of their sexual orientation. Gays and lesbians deserve protection from burdens caused by the indifference or hostility of others. But they are not the only ones.