As has been said elsewhere, the picture is muddled by the fact that per capita income is really fiction and income can, in reality, vary enormously.
I would agree that good living conditions and education reduces the hold of dogmatic religions. People are less dependent on a god's goodwill, and more inclined to crave more freedom. This has been seen often enough.Higher income generally means better health and better living conditions, which reduces the hold which a religion can gain on the population. Historically, religious organizations have been used to control the poor to keep the rich happy. A financially stable population has more reason to enjoy their lives and less need to look to an afterlife.
But it does not mean that nobody wants religion. As said earlier, in DK, US and UK, and quite possibly other places, the dogmatic religions are simply, in some cases, replaced with undogmatic ones. "Freedom religions" you might call them. They do not convert, they do not seek power, there is nothing between whatever people believe in and themselves, and nobody, but nobody, tells them what to think ;-)
I am afraid that is a most shameful fact.The same applies, to some extent, to colonial countries. Most of the resources are taken by the colonizing people, with little remaining for the natives. Coupled with generally repressive missionary activities, the poor population becomes heavily religious.