If you're making comparisons they have to be like for like!
The UK is one of the world's richest countries, and always has been. Spain on the other hand, has always been a poor country. It was less than 50 years ago that democracy was restored after 40 years of Franco's dictatorship.
So you need to compare the UK's economy against one of the big European countries like France or Germany to be able to get a realistic picture.