If one is retired in UK they can transfer their health care to Spain.
As I understand it, if one is working in Spain and contributing to their health service they can get cover in Spain.
If neither of theses applies it would seem reasonable that you would need to take out private health care.
It is only in UK that one qualifies as a result of being resident in UK. In my view an altogether ridiculous situation.