because of the electoral threat of the Greens and an uninformed public.
The solar thing was a farce: Germany created all sorts of subsidies and big plans in the expectation that German factories would be supply the solar panels -- only to be almost immediately outcompeted by more efficient Chinese production (and likely a lot of state subsidies there as well).