It might be the other way around: religions came to be _because_ humans have values that became the backbone of religions.
The evolution of "gods" is obvious in retrospect as well (a tale of some good deeds passed on through generations gets added to with every retelling and suddenly Joe who gave a child an apple and protected it from a rabid dog was walking around feeding everone and killing dragons that stole everyone's sheep).
I recommend reading literature, philosophical and historical works from more than 2000 years ago.