They did not destroy the peoples
as the Lord had commanded them,
but they mingled with the nations
and adopted their customs. (Psalm 106: 34-35, NIV)
I remember the day I was sitting in a Bible study and someone said God would never command the destruction of entire towns. The person was objecting to the Jericho story in Joshua. The argument boiled down to the claim that Jesus would never do that.
Here is the rub, though. We are Trinitarians. When the Bible refers to God, it is talking about Jesus. The Father, Son, and Holy Spirit, all three-in-one, are God.
Jesus in the New Testament is not a filter that we run the rest of the God stories in the Bible through to strain out the parts that don’t appear to us to fit. Jesus is the incarnation of the God who commanded the destruction of Jericho. Jesus, the Son of God, was the same God who sent the angel of death to wipe out the first born of Egypt. Jesus the eternal Word rained fire on Sodom and Gomorrah.
In Psalm 106, we read of the mighty and terrible deeds of the Lord. Jesus of Nazareth knew those Psalms well. They tell his story.