One of the most popular level objections to Christianity is that the God in the Old Testament appears to be just so mean. Many of the "New" (though what is new about them is unclear) Atheists take this view. Sam Harris calls God diabolical, while Dawkin's gives a particularly stirring critique when he says:
"The God of the Old Testament is arguably the most unpleasant character
in all fiction: jealous and proud of it; a petty, unjust, unforgiving
control-freak; a vindictive, bloodthirsty ethnic cleanser; a
misogynistic, homophobic, racist, infanticidal, genocidal, filicidal,
pestilential, megalomaniacal, sadomasochistic, capriciously malevolent
The objection has more rhetorical than intellectual force. It is no argument against the existence of the Christian God to claim that he seems so mean in the Old Testament. At most this would require the Christian to hold that perhaps the Israelites were mistaken in some aspects of their image of God and in attributing some commands to God. This would involve modifying one's doctrine of Biblical inspiration to hold that the Bible, though inspired, maybe not be inerrant in every respect. This would require some adjustment, but hardly be a reason to give up the doctrine of biblical inspiration, let alone the existence of the Christian God.
But would we be required to do even that? I rather think not.
Let us suppose a boy of age 12 or 13. He has no father or mother, has been raised among bad companions and brought up in depraved company. He steals, drinks, vandalizes, engages in gang activity, and generally thinks that might makes right. At the age of 12 or 13, nearly thoroughly depraved, he is adopted by a loving family whose own moral behavior is leagues above his own. He realizes how far above his previous company this family is and tries his best to bring his behavior into line with theirs. Realizing this, the family is patient with him. They even tolerate less than ideal behavior at first with the knowledge that this boy must gradually be brought to improve his behavior. They know that if they demand too much of him too soon, he might give up, or else run away, back to his old companions.
The ancient Israelites were that boy. They were surrounded by other cultures with laws far harsher than their own and with far worse behavior. They believed in many gods, thinking Yahweh to be one of many tribal gods. Now suppose that God wants this people to come to know Him. He promises to adopt them and gradually introduces the idea that they are called to a more moral life than their neighbors. Vengeance is not to be excessive, but limited to an eye for an eye. (Later, even this limit would replaced with the command to turn the other cheek.) Over time God brings this people to a greater and greater awareness of his moral commands, culminating in His revelation of Himself in Jesus of Nazareth.
God could not give his whole law at once for the same reason that the family does not demand too much from the depraved boy at once. The Israelites might simply have given up. They might have switched to other gods (as they had a propensity to do anyway). Yet, in this case, God's plan to bring this people to know Him would have been frustrated. To demand too much too soon of the ancient Israelites would not have helped and might even have hurt.
Some of Israel's laws in the Old Testament strike the modern reader as troubling, but that reader is looking at those laws from the successful end of the spectrum. God has finally made the fullest revelation of Himself in Jesus, whose action, teaching, and death and Resurrection give meaning to the entire Old Testament. And it was in part God's patience to a troubled nation that made it possible. The modern reader owes gratitude both to that troubled nation for the courage to try, and to God for showing them the patience they needed. It was the patience that has let us celebrate the Resurrection Easter Sunday and every Sunday.
Paul Copan, Is God a Moral Monster (2011).