Those who believe the Bible is divinely inspired must wrestle with the story of Jephthah, who sacrificed his unnamed daughter to God. Jephthah’s story, with some indication of God’s continuing favour, continues in Judges 12. I say this is an old tradition where Hebrews believed God demanded human sacrifice- a superseded view of God- but there is no indication of that in the text itself.
God seems more keen to punish those who did not kill: Because you did not obey the Lord or carry out his fierce wrath against the Amalekites, the Lord has done this to you today (I Samuel 28:18). The story is in 1 Samuel 15. God tells Saul to “totally destroy” (the Hebrew term meant “give them to God”, often by destruction) the Amalekites. But Saul spared the Amalekite king Agag, and the best of the livestock. Saul asks forgiveness, but the prophet says, “The Lord has rejected you”.
Possibly, killing the whole tribe was the only possible thing to do. The Amalekites were enemies who would never be allies. They claimed the same land as the Israelites. Therefore, they had to be killed. Possibly also, this is not a historical tale: there is little archaeological evidence for Saul, David or Solomon. From the New Jerome commentary, the book may have been assembled after the exile, and possibly its original sources date back to Jehu and Elisha in the late 9th century: on that reading, Jehu expunged the worship of Baal, and the fiction of David and his successors retrospectively justified that.
In Judges 1, the Israelites could not drive out the Canaanites and Amorites. From Joshua 24, it appears that the Lord gave all the peoples of the land into the hands of the Israelites, who totally destroyed them. From the archaeological record, Jericho (whose walls came tumbling down) was unoccupied at the putative conquest by Joshua. Israel, as the children of Israel the man enslaved in Egypt, taking forty years of wandering to travel the few miles to Canaan and then conquering and existing as one people until the Assyrian conquest, never existed. Instead, there are stories which justify the worship of one God. Even the names of the tribes are different: in Genesis 29-30, Levi is a tribe, and Joseph is one tribe. In Numbers 26, Levi is not named as a tribe, and Joseph is divided into Ephraim and Manasseh.
So rather than God seeking to kill men women and children and their livestock, there is the record of Jehu and Elisha, seeking to unite the peoples in the worship of one God with new stories of events from up to a thousand years before. These stories are augmented and edited after the exile in Babylon, again to unite the people.
A kingdom divided against itself cannot stand. The Israelites throughout their history needed this focus of unity.
Divine inspiration cannot mean that God had people write down stories of what had happened three hundred or a thousand years before.