Religion flourished at its inception because science didn't exist like it does now. As science explains how the universe works, the holes of knowledge God exists in get fewer and fewer. And as more claims of "God's responsible for..." get replaced with "Science says this is how this works..." people notice more and more how prior claims of God did it, were false. So even where God might still reign in our knowledge, people allow for the possibility there's a scientific explanation waiting to be discovered and gods were simply a cop-out used in the distant past.
Plus it's hard not to notice that if there are real gods, who're all-powerful, it's worth asking why they don't just manifest reality and make big fancy churches for their reps on Earth instead of those reps schmoozing and begging for sometimes $150 million to construct a new religious campus. One might assume $150 million could be spent elsewhere than making a few acres of buildings and grassy lawns.