I think religion was made for a society where group cohesion was of utmost importance. This can be most perfectly seen in having to think the right things to end up in heaven. Group cohesion was how things got done. You couldn’t build a castle without a lot of willing, obedient subjects. In this day and age group cohesion is achieved more by technology (such as firearmed policing/military and burglar alarms). The things we desperately need now mostly are scientific breakthroughs for things like clean energy, medicine, and social science. These things come about through people who ask questions, even questions they are not supposed to ask (the discipline of scientific thinking tends to make people less religious). People wring their hands over millennials’ exodus from religion but they have internalized the idea that human progress now comes about by people thinking for themselves, not applying what they’re told to think.