The thing people fail to consdier is exactly what God was judging them for.
The Israelites had adopted the practice of the heathen nations surrounding them of sacrificing the children to false gods by burning them alive.
What kind of God would He be if He DIDNT punish them?
That side of the story (the human sacrifice and cannibalism of children) is inconvenient for people who want to criticize God as cruel and unjust in the Old Testament. To talk to some who dispute the Bible, the Old Testament peoples were all just happy and innocent, going on picnics and flying kites, when mean ol’ angry God just slaughtered them all for no reason.