Societies with certain rules, such as "don't murder" and "don't steal," survived. Societies that didn't have those rules did not. Other rules, like "women need to wear a cloth on their head" do not rise to the same level. That is, societies having that rule do not have an improved chance at survival.
But it is not enough that behaving a certain way will increase your society's chance of survival and therefore your chance of survival. GOD must order it. And not only does GOD like my way better than yours, but GOD condemns your way of doing things. GOD likes me better than you.
A belief in GOD and GOD's will and GOD's rules means survival of humanity.
When people rail on about GOD and GOD's will, they are hijacking GOD's name to their own purposes. How do you think he feels about that?