Great questions. I don’t know the whole answer.
Greg Boyd, a pastor in Minnesota who studied along with Bart Ehrman under Bruce Metzger, tried to write a book defending the violence in the OT, and couldn’t. He wrote a book called “Crucifixion of the Warrior God,” followed by a condensed version, “Cross Vision,” which posited an incomplete understanding of God prior to Christ–accommodationism. Another book by Caryn Reeder, “Enemy in the Household, “ examines the relative morality that demanded in small bands that people absolutely avoid gluttony or disrespect, etc, as that really threatened the lives of everyone else. Caryn Reeder - The Enemy in the Household | OnScript
Jared Diamond, who worked in Papua New Guinea, wrote “Guns, Germs, and Steel,” which is really a very detailed defense that situations define material wealth, rather than intrinsic personal worth. In it, he does describe how small, nomadic groups often wound up killing off all males and absorbing children and women into their group, similar to some American Indians, New Guineans, etc; that, in my mind, may explain some of the thinking in the ancient Near East, too. Paul Copan wrote that much of the OT was hyperbole, but I have not really read his book, “Is God a Moral Monster.” Randal Rauser, who I really admire a lot (a Canadian theologian) wrote several books, including “Jesus Loves Canaanites.” One quote by him was
: It is far from clear that the appropriate response to a culture that murders some of its children is to kill everyone in the culture, including the children.
Two other quotes I really like:
“The dangers of believing in a God whom we cannot but regard as evil, and then, in mere terrified flattery calling Him ‘good’ and worshiping Him, is still greater” (C S Lewis)
If it be said by any that God does a thing which seems to me unjust, then either I do not know what the thing is, or God does not do it…Least of all must we accept some low notion of justice in a man, and argue that God is just in doing after that notion (George MacDonald.)
However, I do think that much of the notions of justice flow from our own interpretation of our environment. The ANE folks, despite their extreme behavior, were known for hospitality and faithfulness; and caring for their children was their lifeblood and hope, I think. They may be way ahead of me in ways I have no idea.
Best wishes!