Sweden, Finland and Denmark are all more or less at the same standard of living as Norway.
The oil wealth is not spent, but put into a fund for the future.
It's possible for Spain if they can somehow mellow out the bi-polarity of the Spanish society of 1910-1939 and get people to get along.
Perhaps the Spanish government sees after WW1 how industry is crucial for national survival and in a bi-partisan effort invest alot in the maritime, agricultural and technological sectors, becoming a larger economic machine. Thusly becoming stabler and more socially mobile, somewhat reducing the internal strife with autonomy(Galicia, Catalonia, Euskadria etc) and creating a more "Spanish" identity.
The more wealth and social mobility the less religious people tend to get, and by this smoothing over the "fall of the traditional catholic authority".
Just my somewhat uninformed 2 cents.