I don't think it was financial reasons (or at least not in the sense that it was costing the country as a whole money).
The fossil fuel industry spent Billions on propaganda. Politicians had the option of fighting that, or using it to become more popular and so get rich.
This cost their countries Billions more than they ever earned. They're still doing it, but they might wake up soon. Still a total waste of time, energy and money though.
> That, in
combination with the downward pressure on wholesale electricity prices, threatened the
finances of the major utilities. Particularly hard hit were the 26 GW of natural gas-fired combined
cycle (GFCC) plants built after 2000 in anticipation of substantial growth in Spain’s electricity
demand, making gas the single largest source of installed capacity. This brand new fleet saw its
overall load factor drop from around 50 percent in the mid-2000s to below 20 percent in 2011
and then continue to fall, almost to single digits in 2014
> As a result of these developments, the promotion of renewable power went, in just a few
years, from enjoying broad public support, or at least tolerance, to facing substantial opposition.
Particularly outspoken in their criticism were large electricity consumers and the major utilities,
whose returns on investment in non-renewable generating capacity was being put at risk
(Linares and Labandeira 2013). These various pressures in turn prompted similar policy
responses by successive governments led by different parties.
https://scholarworks.gsu.edu/cgi/viewcontent.cgi?article=110...
So prices went down, country made money, big interests lost money, specifically natural gas wasn't being burnt enough for their liking, renewables got paused for a while.
Russia (and several other authorotarian regimes) benefitted, but it was mostly Spanish people conning other Spanish people for money.