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).
Now that is a lie. The anti-nuclear push came from the Greens in the 90s. Conservatives just used it for a quick win once that policy became very popular in Germany.