I travel extensively throughout Western Europe and have always noticed that there's a big difference in the relative number of Macs you see between different countries, Spain being one of those countries where Apple would appear to have a good customer base. Therefore, irrespective of size of economy etc, I can see why Apple would see this is a good move. That said, I'm surprised they didn't go for Barcelona rather than Madrid, Barcelona being considered one of the design centres of Europe and full of the architecture and young, trendy designer people that Apple loves to associate itself with.
Apple already has a store in Barcelona: http://www.apple.com/es/retail/lamaquinista/