The artificial-intelligence boom has driven up demand for data centers, sending companies into an expensive scramble for more resources that has sparked resistance in locales housing the facilities.