True but that isn't what happened in Islam. While they were still on a par with the West THEY UNILATERALLY made the move while the West moved towards secularism/science. They NEVER made a move back towards secularism/science. They have not had their Reformation. That is THEIR fault, not ours. The fact that they are NOW so weak and powerless that they can be easily victimized by the West is an indictment of theocracy. It demonstrates that theocracy is an inferior model/world view than the Wests. There is no flood of people to these shitholes, there are only floods of people to Western secular nations. There is a reason for this.
Looking at the major powers in the region, both iraq/iran were secular & modernizing in the past before foreign interventions. It's unclear how many countries in the world can withstand victimization by the US/Soviets (eg. iraq used to have one of the largest militaries), and frankly it's only a coincidence both superpowers are secular, for different reasons.
While it's true strict theocracy is generally a shitty governing model, religion per se isn't an adequate impediment to successful development anyway. Merica is fairly religious, and more powerful than anyone more secular. More christianity or even islam in the US wouldn't have stopped industrial production for the world wars or carried enemies more readily to our shores.