The evil God argument is so cliche at this point that atheists have even made a whole website dedicated to presenting it. According to atheists, God committed some horrible atrocities in the Old Testament, and so He is either a fictional character, or is so evil that He simply isn't worth worshipping or obeying.
It is worth noting that those who use this argument always take the specific examples out of context. If I am exaggerating, which is entirely possible, it's because I have never met an exception. Reading the passage in context often does not even give the impression the atheist wants. When it does, closer examination (usually by reading a few verses in either direction) reveals a very different story. Sometimes the argument hinges on a specific translation. Sometimes, it's so obvious the atheist hasn't read the passage, you have to wonder if they even know what a Bible is. The most hilarious example I have ever seen is a meme entitled "how to kill children, Bible style". The first verse cited? "Mark 9:42 - Drown them." Now, does anyone want to guess what that verse actually says? "“But whoever causes one of these little ones who believe in Me to stumble, it would be better for him if a millstone were hung around his neck, and he were thrown into the sea." Literally the exact opposite of what the meme wants it to say!
And this is the common practice of the atheist. But regardless of the context of all the passages cited, the fact is the Old Testament does contain some difficult passages. We read about these judgements, and we just think "wow God, that was harsh!" And that's the point. We are supposed to see God's judgements as harsh, because they are harsh. God is so Holy that His tolerance of sin is literally non-existent. It must be paid for, and the payment is impossible. And sometimes, this does involve the loss of lives, even the lives of children.
There are three things to consider when trying to understand these passages:
1. Some of God's judgements simply involve Him stepping back and letting Satan run riot.
2. God has infinite knowledge.
3. God has infinite authority.
God's withdrawal
Needless to say, God is quite intolerant of sin. He will not commit it, He will not command it, but He will allow it. This is the case when God steps back and lets brutal enemies oppress the Jews. When the Jews turned their backs on God, God simply withdrew and let their enemies conquer them (e.g. 2 Kings 21:10–16). And this is recorded in the Bible, both as a warning prophecy, and as a historical fact. God is not responsible for anyone else's actions.
God's infinite knowledge
What's the most popular time travelling cliche? "Let's kill Hitler". Ironically, many atheists often complain that God didn't stop Hitler. And yet, if God had stopped Hitler, God would have been the only one to know what Hitler was like, and so they would have complained about that, too. It is vital to factor God's omniscience into understanding His judgements, because He will literally never make the wrong call. God knows what will happen if He makes a certain judgement vs. what will happen if He doesn't. We even see this in real time when Israel refused to carry out God's judgements, and the surviving culture did the very things God warned about if they were allowed to survive. No one has any kind of a right to tell God He should have done something different, simply because He knows better than they do.
God's authority
It should be an obvious fact that authority is not evenly distributed. There are things the government can do that we can't. They can punish criminals, yet if we punish the same criminals, especially in the same way, we become the criminals. Similarly, you can pick your own locks legally, yet if another person picks your locks, that's called breaking and entering. Unless, of course, you give them permission.
Well, the entire universe is God's property. He can do what He likes. He can set any rule He likes, and He can set any punishment He likes for breaking those rules. He could even legitimately (though thank God this is not the God we serve) punish someone for no good reason. He has the right, though thankfully not the desire, to dole out arbitrary punishments. He can make or break a human just as rightfully as He can make or break a plate. Who are we to tell Him otherwise?
And that's just the problem. Who are we to tell Him otherwise? Atheists fail to realise that in order to accuse God of any form of immorality, they must first assume a standard of morality exists that He must conform to. But they can't say that if their worldview is true. In fact, ironically, many atheists will admit that because they don't believe in God, morality is just a matter of opinion. You can even press an atheist to comment on the Holocaust. Some of them try (and fail) to justify calling it evil in atheism, but others admit that if atheism is true, all they can really say is that they don't like the Holocaust, but it wasn't really evil.
This is the embarrassing mess of atheism. Who else but an atheist can say that evil does not exist, but also claim that Christianity is evil, which can only be argued if a standard of evil exists that is contrary to Christianity, which happens to be the point you are trying to prove and disprove at the same time? As a man who spends years brooding over a simple paradox, I simply cannot imagine sleeping at night as an atheist. Contradictions just don't work for me. I prefer logic.
As it happens, God is not evil. Quite the opposite, God is just. Those frightening judgements we hate to hear about Him carrying out are just judgements, launched against impenitent sinners. And that's the scary thing. We are sinners, too. The very things God judged so harshly, while they were at their peak, are the very things we do today, and we continue to head towards. We cringe at God's judgements not because those who received them didn't deserve them, but because we deserve it too.
But there is one last thing we need to understand about God to understand these judgements: He doesn't want to dole them out. There is an alternative He would prefer we take: that of repentance. See, 2,000 years ago, God sent His Son, Jesus, to be born of a virgin, live a perfect life, and die on a cross. Jesus took the worst judgement of all, the full wrath of God. Every sin we have ever committed, He was punished for on our behalf. With your penalty paid in full, you can be reconciled to God. Simply confess Jesus as Lord and believe in your heart that God raised Him from the dead, and you will inherit eternal life in Heaven.
Recommended song: Wolves at the Gate - Majesty in Misery