Nobody insures the building for youAt home: In most cantons a public cantonal insurer covers buildings against fire and natural hazards. Here: There's no public buildings office here. It's a private policy, plus the state fund for major events, and that fund needs the policy in force.
Moving changes your KVGAt home: If you move abroad you generally leave compulsory KVG cover, with listed exceptions. Here: One of those exceptions matters here: someone receiving a Swiss pension and living in the EU stays under KVG, and Spain is in the EU. If you keep your Swiss residence and only spend winters here, you stay insured at home too.
Major floods go to a state fund, and it needs your policyMajor floods, earthquakes and rare storms with gusts over 120 km/h go to Spain's state fund, the Consorcio de Compensación de Seguros. It pays only if you have a damage policy in force with the premium paid, so an empty house with no policy gets nothing from it. It needs no government disaster declaration, and rain coming through the roof doesn't count as a flood.
This is a general guide, not a policy. What you're covered for depends on the policy you sign, and Carlos will explain it in writing first.