Hey I get where you're coming from (and that's why I made sure to check chicken keeping laws before I moved to my new house), but it doesn't make the laws in OP's town any less silly. Taxpayers may not have even gotten to vote on whether their money went towards this specific thing or not.i don’t agree with the surprise inspections either but it’s written very plainly in the bylaws for OPs town.
as for the rest of your post, we (for the most part) get to choose where we live. if you don’t like how tax money is spent in a certain town, you can vote with your hard earned dollars and take them to another town that aligns better with the way you want to live.
this isn’t a hard concept at all. emotional responses to black and white issues rarely help.
100% agree with you that it's important to know the laws before keeping chickens, but my comment was strictly about how silly these laws are to begin with.
Edit: I also want to add that some parts of the law may not be as black and white as you describe. I don't think most people would expect that quarantining a sick hen in a garage would cause problems with the law saying the hens must be confined. Most people also might not expect a garage to count as part of the house. There are some grey areas here.