I would suggest that most (not all I admit) came with their own income and savings - so they weren’t a burden on the Spanish authorities.Wonder what the Costa del Sol thought of us nice Brits moving there in the 70/80s
Spanish people sold them their houses too.
This is a subject close to my heart because I want to retire there. The system is organised so that foreigners retiring there are not a burden and actually boost the economy.