Correlation is not a causation. In poorer countries the importance of religion is generally higher and the quality of education is generally lower. On the other hand, in wealthier countries religion prominence comes down to cultural traits. There's Canada/Finland and there's UAE/Switzerland.
(edit) IQ is not lower because nation is more religious. IQ is lower because the nation is poorer. It is also more religious for the same reason. Wealth is the cause. Plotting two derivatives agains each other is fun, but makes little sense.