I agree that datacenters should be treated like industrial sites. Most people wouldn't want a micro oil refinery or machining factory put up 300 meters from their house. Regulate datacenters like we would a factory. Require them to account for their inputs and their waste outputs, and prohibit them if noise levels are too high or if a concentration of them affects the local climate through heat waste.
EDIT in response to the below comment, since I've been throttled:
Noise and heat are outputs of datacenters.
They have no waste output.
While I agree on noise, heat output tends to be comparable with a large shopping mall, and they use way less of all other local resources (assuming they are paying market rates for electricity etc. and not some bribe-level "tax break")
Noise requires certain extra investment at building time but can be very much mitigated below 40dB. At mid-scales (12~15 MW usable power) you can have a datacenter pretty much beside residential building and it will be the quieter one.