I have seen some rich countries which are fairly religious. Like Saudi Arabia, Kuwait, Bahrain, Qatar, UAE, Oman, Portugal, Italy, Greece, Poland, Morocco, Malaysia, and Brunei.
Being poor and religious is just a stereotype.
Look at Sultan of Brunei, he is filthy rich and rules his country according to Islamic edicts.