There is also a religious element to suicide that cannot be overlooked.
Also, I Spain your view of Spain is tainted. I think very few people would choose an average city in Spain over e.g. Copenhagen where 20% of the Danish population live.
> There is also a religious element to suicide that cannot be overlooked.
Also a genetic component.
Have you eaten everyday food (not gourmet) in Copenhagen?
The perception of Spain is much more positive in the Anglophone world - it's viewed as a country where cost of living is low, you can nap in the middle of the day, the women/men are hot and easy, the wine is great and cheap, and you can party late at night.
In reality the average Spaniard isn't experience the majority of that, as those are perceptions that arose from the rose-tinted glasses of tourists. Most tourists don't know about the Eurozone crisis, the regional disparity, and the consolidation of Spain's economic growth engines to 1-2 cities.
Spain is a good developed country with a decent QoL as is reflected by it's HDI and developmental indicators (and the fact that it has outpaced historically richer and more developed Italy is a testament to that), but tourists almost always take a rose-tinted view whereas locals almost always take a negative view.
And I think this is the crux of the issue with how the "World Happiness Index" is used in American discourse - in the US almost no one vists Europe or other parts of the World for extended periods of time and most Americans lack familial or social ties in Europe. As such, idealized images of Europe ("a socialist paradise" or "white Christendom under siege") have taken hold in popular discourse and are used as proxies for the American culture war.
All the Spanish cities I've visited have looked "perfect", but there's a lot I don't see as a tourist, e.g. that Spain has one of the highest unemployment rates in Europe (10.5%).