Not sure the legal process to shut these down, but they are a blight on our society. I made the mistake of driving through Manderson, WY recently - even Wikipedia notes "The town is widely regarded as a speed trap for tourists heading to Yellowstone National Park." No kidding. I had blown a tire off-road in the hills above town and was driving slow on a spare, and they still nailed me for "speeding." No use fighting it, as the online chatter is that the town judge and prosecutor are as corrupt as the three full-time cops. (Did I mention the town population was 88?)
There is a small town in Florida that was known as speed trap. The state made improvements to the highway which no longer goes thru the town anymore.