>Being ahead of the game is never a bad thing, especially when small towns are so easily exploited due to income and infrastructure. They just can't afford long legal battles.
It's not merely "never a bad thing", for certain tools like zoning it is, at least in the jurisdictions I know of, required to be well ahead and consistently enforced. It's not something towns are allowed to do retroactively, if you have no proper legal town plan/zoning setup in place as well as various ordinances like noise then by default the only controls are the relatively weak state ones. There are many things a government is allowed to do if it's part of an overall plan that applies to all equally, but not if it's "we just don't like those guys specifically", and the best way to demonstrate that is to be making no special moves around a given arrival at all but rather to have it all setup.
Of course, there are as you suggest lots of other good reasons to be ahead too. It's a lot easier to consider things thoroughly and get community agreement when there isn't massive time pressure or lobbying going on and emotions aren't running high. It's easier to get some expert consultation at reasonable prices (in some cases there may even be community members with the skills and willingness to volunteer if it's not a time crush), to enact longer term infrastructure plans, to get any state approval if needed, etc etc. But there are legally serious hard lines as well and if towns are caught napping they may just not be able to use them at all.
> especially when small towns are so easily exploited due to income and infrastructure.
Small, remote towns without electricity or data connections are not easily exploited for data centers.
Instead it's locations that begin with cheap electricity (attracting the datacenter) but the residents fear a significant increase in electricity costs with no local economic benefits to offset it.
You have to be fair on this though. The time to ban something is before they start talking about doing it, not after. Being ahead of the game is never a bad thing, especially when small towns are so easily exploited due to income and infrastructure. They just can't afford long legal battles.