I imagine this must be a ghastly situation for everyone - particularly the owners in the two tower blocks.
The suggestion that everyone must/should contribute seems odd, but not not unique. You need to check the deeds rapidly, which of course that is crucial.
It is not unheard of to have a "joint & several" liability clause in the sales contract/leases for blocks of flats, but that would be highly unlikely, closely defined and any liability would not usually extend beyond that of the flat owners.
As far as you are concerned I really cannot see any basis upon which you have any responsibility to contribute. This seems a bit far fetched, perhaps wishful thinking by the flat owners? But there might be ramifications to you for the indirect consequences of the problem, perhaps your solicitors is remiss in not advising you of the situation - but that's par for the course in Spain.