Last week, the Kansas House of Representatives passed a bill (pdf) that would have broadly legalized discrimination against gays and lesbians. Luckily, after national outrage, the bill was halted. But the fight isn't over: the bill's reliance on religious freedom to justify discrimination is a sign of right-wing efforts to come.

The bill's scope was impressive in its expansiveness: Kansans would have been able to legally refuse to provide just about any service to anyone whose relationship they dislike for religious reasons, and could have refused to provide services "related to" any relationship they dislike for religious reasons. The bill specifically enumerated adoption, foster care, counseling, social services, employment and employment benefits, as well as the general categories of "services, accommodations, advantages, facilities, goods, or privileges", as permissible areas for discrimination.

In other words, under the bill, any individual Kansan could have hung a "No Gays, No Lesbians, No Dogs" sign on the door of his restaurant. Any individual Kansan could have refused to hire someone, serve someone a drink, rent someone an apartment, sell someone a pair of pants or accommodate someone at a hotel if that someone is gay. Any employer could even have refused to extend insurance coverage to a gay employee's husband or wife if he thinks same-sex marriage is wrong. Even government employees paid with everyone's tax dollars would have had carte blanche to discriminate – social workers don't have to work with gay couples, police officers don't have to come to the assistance of a gay person in need.

And if a gay person discriminated against by an individual or a private business decided to sue? They would not only lose, but under this bill, they would have had to pay the other side's attorney's fees.

This hateful backlash is, of course, a response to the increasing acceptance of same-sex marriage, and the fact that marriage equality's inevitability is finally dawning on conservatives. Virginia is the latest state to see laws against same-sex marriage fall, and it won't be the last. But situating the discrimination in religious liberty is about more than just homophobia: it's part of a larger right-wing strategy to allow those who hold particular religious beliefs to make the rest of us live according to their whims.

It's a tactic that well-funded conservative groups are bringing to the courts through the Affordable Care Act (ACA), and it's their legal arguments that undoubtedly gave ammunition to the Kansas legislators. In more than 100 cases, a variety of organizations and employers are asserting their right to determine the healthcare their employees may access. The argument in many of the cases is a novel interpretation of religious liberty: that such liberty not only gives individuals the freedom to practice their own religions, but that for-profit companies have religious rights and are not obligated to abide by generally applicable laws if the owner of those companies believes that following the law forces him to pay for something he finds objectionable.

In the ACA cases, the objectionable matter is birth control – a good start, given the propensity of politicians and the courts to see women's reproductive health as less important, and more up for general political debate, than other aspects of basic health care. Religious owners of companies ranging from arts and crafts stores to car dealerships to cabinet makers all claim that because they think birth control is wrong, their employees should not be able to have it covered in their health care plans.

The logic is the same as that behind the Kansas law: religious freedom means the freedom to limit everyone else's rights.

Kansas legislators claimed that this law is about preserving the rights of religious folks to exercise their beliefs without state interference. But that's not the case: no one is forcing a religious individual to violate the tenets of their faith. Many people find same-sex unions morally objectionable, and that is their prerogative. Luckily, no state in the nation is forcing religious Christian men to marry each other. No state in the nation requires religious institutions to perform, promote or sanction same-sex marriage. No state in the nation makes it illegal to hold or express negative views on same-sex marriage.

The big violation of religious freedom at issue here is the requirement to live in reality – in a country where same-sex marriages exist, and where gay people exist, and where it's increasingly impermissible to discriminate against people because of their sexual orientation. The Kansas law tried to give religious people who dislike homosexuality not only the right to live according to their beliefs, but also the right to exclude gay people from any facet of public life over which the religious have power.

Religious freedom is a cornerstone of the US constitution. The right to live and worship as we choose is a foundational American value, highlighted in the very first of the original amendments. But your freedom only extends as far as my nose. I shouldn't be allowed to refuse to help a Christian crime victim if I'm a Wiccan cop. I shouldn't be allowed to refuse to serve black patrons if I'm a white restaurateur whose sincere religious beliefs hold that black skin is the mark of Cain and therefore the races shouldn't mix. And I shouldn't be allowed to refuse to accommodate a lesbian guest if I'm a fundamentalist Christian hotel owner.

Shifting American power structures make those happy with the earlier hierarchy increasingly uncomfortable. And that makes sense: if you're a middle-class white Christian in the United States, you're used to broader social norms both reflecting and revolving around your beliefs, values and experiences. As other groups gain recognition, rights and power, those who are uncomfortable with progress will come up with new and creative ways to maintain their hold on power.

That's what underlies the right-wing hostility to reproductive freedom: all over the world, access to family planning tools translates into social, economic and political gains for women. It's not about birth control; it's about gender equality, and how that equality undermines a conservative vision of an ideal male-led society and family. Societal acceptance of homosexuality poses the same threat: if a nuclear family can have two women heading it, there's not much of an argument for keeping women and men tied to restrictive, heterosexual gender roles.

Attempts to keep us straightjacketed into traditional roles, and the power structures that serves, is what's behind hostility to both women's rights and LGBT rights. The legal strategies to advance and scale back those rights have also gone hand in hand – the right to sexual privacy underlying the cases that legalized birth control and abortion also played in Lawrence v Texas, which invalidated a Texas law against sodomy. And now, the arguments presented in the ACA cases seeking to limit women's access to birth control are being used to push the envelope on discriminatory laws seeking to exclude LGBT Americans from public spaces, and situate them as second-class citizens – quite literally secondary to the comfort of those who would use religion as cover for bigotry.

The Kansas bill didn't become law because the forces behind it are losing. That's cold comfort to gay Kansans who were just issued a very clear "you are not welcome here" message from their elected officials. The Republican party, whose members have yanked the welcome mat out from under the feet of too many groups, should perhaps consider whether a strategy of alienation is a winning one. After all, are there many strong supporters of this law in Kansas who weren't already voting Republican? On the flip side, younger voters overwhelmingly support gay rights. And so do gay people – increasingly, so do their families and friends. A plan of aggressively antagonizing LGBT people is not a winning one.

The many of us who abhor blatant, legal discrimination are rightly incensed about even the fact that this law was ever put on the table. But we should also see it for what it is: just one piece of a much larger puzzle. The really crucial part – the legal backing for laws like this one – will be decided by the US supreme court very soon. If the court allows for as expansive interpretations of religious freedom as the anti-ACA plaintiffs have argued, expect to see more of these laws proposed and passed in the states. And then, segregating Friends of Dorothy won't just be in Kansas anymore.