Norway joined NATO because they were liberated by the UK from Nazi occupation during the war.
They were scared of a future occupation and given an offer they essentially couldn't refuse from the US/UK. Of course, it was a jackpot, since Norway actually borders Russia in the far North.
Plus Norway traditionally has good relations to the UK since they are neighbours across the North Sea - they were always likely to go in that direction.
Secondly: Norway was quite backwards, and poorer in comparison with Sweden and Denmark -- until they found oil.
Once they found oil early 80s they were able to improve things a lot. Essentially, Norway is built on the Swedish model.
They are a law abiding country with very little corruption:
The state took care of the oil and used it to build up a better country.
They have been very good stewards of their oil riches and I am glad for them that they found it.
The current prosperity will last a while longer than the oil.
Like Russia, they are trying to diversify - but they took a hit with the oil price recently and had lots of layoffs.
The traditional industry in Norway, is fishing....
So make no mistake: Norway is a lovely country with wonderful people, but the reason for the wealth has nothing to do with any NATO membership:
It's down to the oil and the Lutheran heritage of hard work and honesty.