The origins of deity belief, which may date back to 70,000 years, were attempts to understand the world in which people found themselves. We did not arrive here, with an instruction manual or a Google search engine. We found ourselves asking questions and too, found ourselves very vulnerable to other animals and the harshness and whims of the climate. Gods, totemism and animal worship were an infantile way to explain and to begin to define life. Such was the first attempt at science.
Fear and reward are prime motivators and like today, there were the unscrupulous who realized that the lessor intelligent or more fearful and gullible could be easily manipulated and controlled with the use of these beliefs. In some instances these controls were not all bad, as groups or tribes were formed around these leaders, which provided protection from others, food and overall security for the clan or tribe. The first societies were created around such leaders, who embodied defined spiritual qualities and strength of leadership; normally the alpha male.
With the advent of the atomic bomb Albert Einstein wrote a letter to Harry Truman warning of the great perils that lay ahead. He admonished Truman by saying, "The unleashed power of the atom has changed everything save our modes of thinking and we thus drift toward unparalleled catastrophe."
All has changed and we have grown tremendously from the fearful cave dweller of 70,000 years ago, but we still cling to the idols and the totems for comfort and security. We are still magnetically drawn to the promise of the infantile mind.and to those unscrupulous alpha personalities who manipulate through the godly promise of a promise. It is in this that good people and those with deviant tendencies are driven to bias and hatred, driven by the justification of a god to commit acts of brutality and savagery.
Fortunately, as time passes and a greater understanding of life emerges fewer are drawn to such ancient savagery, as Christianity was defanged by the Bill of Rights and good people are left to be good people, there are still those who can and will justify human savagery with the gods.