Spain's shut down was the same reason Spain has cheap electricity compared to Germany: They've chronically underfunded their grid infrastructure and haven't properly adapted to a renewable grid.
Germany has extremely high renewable penetration, and has one of the most stable grids (if not the most) in the world.