The depopulation problem of MOUNTAINOUS regions of Europe, including Spain, has little to do with jobs being available elsewhere. The depopulation in those mountainous regions is due to those regions being undesirable for human habitation all the way, and the recent advent of technology and infrastructure making it possible for people to go to other places. These regions were inhabited only because people had to live there and the human society's infrastructure could not carry millions of people in a central location.
Poorer regions like Extremadura and Andalusia have been neglected for centuries and now the economy is so dire we are seeing a mass migration from south Spain to other regions.