You also want cheap, reliable power. Ideally eco-friendly. And you want backbone connectivity, of course. Local suppliers who know the construction and maintenance needs of a data centre. No earthquakes, hurricanes, wildfires, flooding, or tornadoes. A local government that won't tax you too much, and that won't get upset when you employ very few people.
Most large companies impose certain costs on society, and have to manage their reputation. Often it's cheaper to improve public opinion in a peripheral area than to address deep-seated problems.
Putting a data centre close to a hydroelectric dam helps offset your product's impact on users' mental health, your disregard for competition law, etc.
[1] https://datacenters.google/operating-sustainably/ [2] https://sustainability.atmeta.com/data-centers/
Those lists are the companies marking their own homework and congratulating themselves as PR, AKA "greenwashing". They can do that just fine by spinning a single metric of their choice where they do less-badly than their pick of mean, median, and mode of whoever else they want to compare themselves against, they don't actually need to be genuinely eco-friendly at anything.
There's also network (pun intended) effects. Northern Virginia has been a major internet hub for a long time, with the first non-government peering point and a bunch of telecom companies, including AOL.
The data center land isn't that expensive anyway. Northern Virginia can be tremendously expensive, but the data centers are built out in the relative sticks. I'm sure the land would be cheaper in Wyoming, but it's cheap enough.