What do home Bible study classes, transgender bathrooms, lemonade stands, cat litter, and marijuana have in common? To the blind eye, not much—but in fact, they're all things state and local governments are actively working to regulate.

Recent legislation in North Carolina blocking cities from allowing trans individuals to use public bathrooms that are marked for the sex they identify as (instead of their biological sex at birth) has caused quite a ruckus. Many libertarians take issue with a state moving to quash a local ordinance—in this case, one written by the Charlotte City Council to allow transgender people to pee where the hell they want.

This is hardly the only instance of a state government acting against cities that want to implement freedom-enhancing policies. But while states are rarely consistent champions of individual liberty, it turns out local governments are frequently the worst offenders of all when it comes to petty tyranny.

The Charlotte ordinance that triggered state sanction added sexual orientation, gender identity, and marital status to the list of attributes protected from discrimination—not just for public accommodations such as hotels and railroads, but also for private businesses like restaurants and retail stores. This is more problematic than it might sound: The right of a private individual to decide with whom to do business according to the dictates of her conscience is the very essence of free association.

Local governments in some places have prohibited businesses from offering gender-neutral bathrooms, while in others, like Washington, D.C., they've prohibited single-stall bathrooms from being designated for one gender or the other. (Is it any wonder small businesses struggle to comply with the minutiae of local regulations?)

The buttinskyism extends far beyond bathrooms. Dozens of places, including Austin, Texas; Sacramento, California; and Thurston County, Washington, have banned supermarkets, convenience stores, and pharmacies from providing customers with free plastic bags.

"Many cities restrict the economic freedom of their residents and potential migrants through minimum wage laws, business licensing, rent control, and zoning restrictions," Mercatus Center state and local policy expert Adam Millsap explains. And many of these regulations, particularly zoning and occupational licensing laws, place a disproportionate burden on poor people and minorities.

This reality is at odds with the widespread belief among libertarians and conservatives that local representatives are better-suited to look out for the interests of their constituents than are state and especially federal lawmakers.

Many on the political right believe that the devolution of power to lower levels of government can help overcome problems created by centralized authority. Superficially, such federalism makes a lot of sense. Just as devolving powers to competing states feels like it should be freedom-enhancing, devolving powers to thousands of competing cities and towns should be the ultimate check on the spread of bad laws. After all, local government is as close to "we the people" as governing institutions can get.

Mayors, district attorneys, law enforcement agencies, and local bureaucrats should be more attuned to the needs and desires of their constituents, with whom they live and interact from day to day. And because it's easier for citizens to move from one city to the next than to relocate to another state or country, that low cost of exit should keep local officials behaving responsively and responsibly. As Millsap notes, "This interjurisdictional competition among local governments should be even more pronounced today as many cities are experiencing population decline [and] will find it increasingly difficult to raise revenue."

But as the depressing array of bad policies being implemented at the local level shows, that devolution of power is often better in theory than in practice. In fact, there's evidence that states can act as a check by forcing local governments to adopt better, more liberty-friendly policies. In 2014, for example, Oklahoma passed a law preventing cities and counties from increasing their local minimum wages beyond the federal rate.

Bans on rent control are another instance of states enacting freedom-enhancing rules despite local-level protests. "Boston was forced to eliminate rent control after a state law was passed by referendum in Massachusetts," Millsap writes. "The state of Washington also doesn't allow rent control, much to the chagrin of Seattle politicians who are trying to implement it." The same is true in California—and that's a good thing, since rent control both restricts the ability of apartment owners to earn income from their privately held assets and makes it harder for people to find apartments.

In some cases, states have even taken a stand against federal government abuses, like when Colorado and Washington legalized marijuana despite its status as a highly (and illogically) restricted Schedule I drug.

However, there are also instances when the federal government has actually had to step in to force states to end discriminatory or unconstitutional practices. The 13th Amendment outlawed slavery while the 14th Amendment recognized the natural rights of former slaves. Believe it or not, the Federal Trade Commission and Department of Justice—hardly freedom-loving institutions—routinely argue against local regulatory barriers to entry, such as Certificate of Need laws and even some occupational licensing schemes. In the 1990s, the Federal Communications Commission barred local governments, homeowner associations, and cooperative and condominium managers from unnecessarily restricting the installation of television dishes on residential buildings.

Of course, that's only when Washington isn't busy imposing restrictions on individual freedom of its own, or infringing on the legitimate authority of the states—as when it tried to use Obamacare to coerce Republican governors into expanding their state-run Medicaid programs. The truth is, when it comes to terrible laws, there's plenty of blame to go around.

In a 2014 paper, George Mason University economist Richard Wagner explored whether federalism really supports liberty. He found that devolving power to lower levels can be good for individual freedom under the right conditions—but it's far from guaranteed. In fact, depending on the specific institutional framework within which governance occurs, pushing power downward from Washington may actually discourage liberty.

The problem, Wagner explains, is that the competing governments we'd expect to see under federalism have been replaced by cartelized governments. As a result, with very rare exceptions, our federal, state, and local representatives act in ways that grow their own power while shrinking our freedoms. Though states and localities still possess some governing capabilities, Wagner explains, they are not truly independent political bodies. In reality, they retain power only so long as Washington allows them to.

The federal government is so big today that state and local bodies have incredibly narrow margins on which to compete to attract taxpayers. No matter where you live, your federal tax bill is by far the biggest tab you owe on April 15. This limits the ability of states and localities to compete by offering lower rates and leaner government operations. And since state and local taxes can be deducted from your federal bill anyway, there's virtually no incentive for them to reduce their levies.

Wagner would say that the petty tyranny of local government is happening not in spite of federalism but in many cases because of it. To change this sad state of affairs would require true competition among jurisdictions—and an understanding that governments derive their rights from us, instead of the reverse.