I'm from Spain, so I'm quite sure of what I'm talking about. Spain might be a highly developed country, but its gdp per capita is not too high compared to the likes of Germany, UK, France, Denmark, US, et al.
Basque country is, again, rich because it has an special tax treatment and could be considered a tax heaven to some extent.