It doesn't even have to be that perfect. It could be a construct of beliefs to help dominate, organize, or network people. It could function to spread messengers across continents and bring in resources or inspire order by fear. It would serve to ensure survival and a way of life, even if that way of life is horrible by our standards. If it helps people want to become better or seek knowledge and harmony, then it is all the better.