That’s a great point. I wonder if it’s motivated by value or fear of an eternity of torture in the afterlife, though.
Propagation of societal values and/or fear of hell and/or fear of death assuaged by the assurance of an afterlife and/or being able to rationalize away the vagaries of nature as the will of god(s) are just optimizations after the core system was already invented.