I explain some reasons for the destruction of all the people or Canaan.
Here are some links to read and consider other explanations.
Ultimately, it is important to know a whole God who is love but certainly is not only love.
Romans 11:22 (LSB) Behold then the kindness and severity of God; to those who fell, severity, but to you, God’s kindness, if you continue in His kindness; otherwise you also will be cut off.
Why did God command the extermination / genocide of the Canaanites, women and children included? - an article from Got Questions Ministries https://www.gotquestions.org/Canaanites-extermination.html
Why did God condone such terrible violence in the Old Testament? - an article from Got Questions Ministries https://www.gotquestions.org/Old-Testament-violence.html