Spain did a lot of mistakes. I.e. not to take any action to stop the real state bubble, create unnecessary infrastructure, or the fact that a plenty of youngster stopped their education in order to work as construction workers.
The were some talking about burst the bubble in 2004, but Zapatero's government never implement the reforms. The Spanish prime minister regret later about not bursting the bubble earlier.[2]
Spanish banks are well protected against loans because, the asset pledge as collateral" clause is rarely use in Spain.
[1] http://www.businessweek.com/news/2011-12-08/sabadell-buys-ca... [2] http://www.elmundo.es/elmundo/2011/06/28/suvivienda/13092749... (Spanish)