The survival of our species mandates that we get along with others because if no one did, we would have long ago perished. Countless species are no longer here for one reason or another. They did not have the genetic makeup to survive the cold, the heat, the droughts, predators, disease, etc. With humans, we could have also gone extinct. Cavemen would hunt for shelter and instead of building their own would kill another caveman and take and rape his wife. This led to humans finding ways to protect their caves by telling their children they would be killed if they didn't listen to the family head by taking turns at guarding their cave and learning how to make and use a spear.
Fast forward to where humans survived the elements and learned how to kill and domesticate lower animals, they had to agree on cooperation among the tribal members. There is and was infighting among the members who grumbled about some members not pulling their weight or fuming about the rules the tribal chieftains laid down to control the tribe. Stiff penalties would be meted out for things such as killing a member of the tribe, theft of pelts or spears or food, and eventually, laws had to be handed down. Long before Moses existed, laws were put in place to control humans so that people could exist somewhat peacefully. Naturally, there were always those who would flaunt the laws and not get caught but those who did were put in confinement, tortured in the town square, hanged, had their heads cut off, hands cut off, were tarred and feathered. What they did to humans was gruesome and necessary to let those who disobeyed the laws know what would happen to them. FEAR sells and FEAR controls.
As I said, some devious intelligent humans got away with murder, theft, rape and all manner of horrible acts in spite of laws. Constantine, a ruthless murderer himself who killed his own wife and son, and was made a saint by the Catholic church, had trouble controlling the populace despite laws. Christianity was not an approved religion at the time but he saw a way to get help. He got with the high priests and ordered them to refine their doctrine to make it known to people that Jesus wasn't just a son of God but was also God himself (Trinity) and people needed to believe this and Jesus (God) demanded obedience or there would be hell to pay. This way, Constantine had an invisible enforcer who would make sure that if you got away with murder, you would pay in an afterlife.
So this was the control through fear and an ingenious one. You would pay a high price if you did not believe. This kept many people in check, and many Catholics use that line by saying something like C. S. Lewis (a disingenuous writer) said about risking eternal damnation if you didn't believe. The question is do believers stay "moral" to save their own hide or because it is the right thing to do for the advancement of the human race? I am not saying that the ruse isn't useful. I am saying that there does not have to be a "God" behind the ruse.
If people need the ruse and behave better with it, that doesn't mean the ruse is true, does it? Saying that it makes some people behave also does not make the story true. There are heinous murderers in jail who are devout Catholics and would kill another inmate if they disparaged Jesus or Mary. There are many nonbelievers who live good and moral lives. Denmark is a prime example.
Yes, some atheist rulers have killed millions. So have religious rulers. Morality is needed for societies to prosper. Some on the left scorn the morals and values that got humanity where it is and want to make up their own or allow people who steal and kill light sentences out of a sense that they had a bad childhood or (fill in the blanks). Would Christians run amok if they knew tomorrow there was no God enforcer after one dies? Maybe. I'm not so sure. For those who are moral because of that belief, so be it. That still doesn't make the belief true.