One of the things to understand about the USA is all the layers to our government. A person living in any arbitrary place in the country has to deal with laws enacted by a Federal government for the entire country, a State government, and possibly more than one local government (perhaps a County government, and a city/town government). The "lower" layers enact policies that benefit the local community directly and which are too detailed for the Federal or State governments, like zoning laws and public school administration.
The US Constitution explicitly devolves powers that are not assigned to the Federal Government to the States, and the States assign powers to local governments where it makes sense. But local politicians are not always the most adept legislators. They are elected from the local community on its own terms. These local politicians may not always understand the limits on their power. One would hope the town lawyer does, but the local politicians are not obliged to listen.
So, what it comes down to is that these policies in some rural Texas town are being enacted by some local politician who may have been elected by 300 people, may or may not be a lawyer, and who may not understand the full extent of whether their policies are even allowed under State law. Yet they are empowered to do it anyway, and when their decisions involve an issue that has nationwide visibility, it becomes nationwide news. People can be upset and shake their fist over it, but nothing can be done unless the citizens of that small town decide to change it (or their State government finds that they never had the power to do that in the first place).