Spain did it because the Muslim terrorists bombed their train and told them to withdraw the troops. Anything else they want
Spain to do will be done.
It was never that simple.
Firstly the Spanish people were overwhelmingly against sending troops to Iraq in the first place.
Secondly the incumbant government at the time deliberately tried to blame the attacks on ETA as they new their Iraq policy was already unpopular. Once this attempt at spin came out they were doomed in the elections.
Once this came it out in the open the goverment was doomed. The Spanish people voted in the opposition whose Iraq policy was more popular (and had been more popular before the bombings anyway). That's just democracy in action: don't implement unpopular policies and then lie about the consequences.