Yes, the geopolitical situation with the Cold War helped Northern Europe. But don't underestimate the vast amounts of money the EU has invested in Spain and Portugal since the 1970s.
Lots of money yes, but not that well invested. Scratch the surface of EU funding and you find a long procession of malinvestment and wasted opportunity. Airports being a famous case in point:
Well, Portugal and Spain were not really affected by the war. They were, however, affected by the isolationist dictatorships that they had to suffer under for another 30 years.