Very true. People need purpose and structure. Failing that, they’re going to find something to fill the void.
And this quest ultimately ends up at God’s doorstep, if pursued with intellectual integrity. However there are dangers encountered on the way.
The bible has posited an explanation that I’ve never seen improved upon. People (as a group, somehow capable at that point of accord and communication between souls, else other theology in the bible would not make sense) accepted a premise from the devil that they could craft their own moral realities. This made people feel super important while at the same time putting a huge chasm between themselves and God, who kept on insisting that the only valid moral realities were what He instituted. No Einstein is needed to perceive that this is a recipe for tragedy.