It’s also about energy security - why expose your energy markets to insane fluctuations in international fossil-fuel markets if you don’t have to? Surely the last few years have shown that energy independence is a critical social and defence policy now?
For many/most countries, investing in renewables is the best, cheapest and fastest way to move in that direction.