Data centres consuming electricity isn't the problem. The problem is running those data centres on fossil fuels.
There has been an increased push to run the data centres on green technologies like solar, wind, and nuclear, e.g. [1]. Due to the machines being co-located makes it easier to do this compared to every website being hosted on machines spread over the country, where it is more likely that they will be run by fossil fuels.
[1] https://www.reuters.com/business/energy/rush-data-centers-cr...