“Atheists say that God is a thug and is not moral at all… what about the story of the bear mauling kids to death just because they called someone bald? Why is such material recorded in the Word of God?”
“… Elisha… went up… and… there came forth little children out of the city, and mocked him, and said… Go up, thou bald head… And he… cursed them in the name of the Lord. And there came forth two she bears out of the wood, and tare forty and two children of them” (2 Kings 2:22-24).
God’s covenant with Israel said that He’d curse them if they didn’t obey Him, with the intensity of the curses increasing if they persisted in their disobedience (Lev. 26:14-21). So we know that God’s people in Elisha’s day must have ignored His initial curses if He allowed wild beasts to rob them of their children (Lev. 26:22).
“Little children” go to be with the Lord when they die, so the bereaved parents of these little ones were the biggest losers. But if losing their children caused them to begin to obey God’s law, it may have led to their eternal salvation. And God is always more interested in our eternal destiny than He is in allowing us to lead a trouble-free existence in this life. source