In the old days of the Old Testament(2nd millenium BC), God commanded that the Canaanites who lived in a few particular settlements ought to be exterminated. This was an exeption o course. One of the very few examples is 1 Samuel(1 Kings) chapter 15. This troubles many Christians and is used as a "weapon" by enemies of the Church.
For centuries, those people practiced bestiality, incest, sodomy and human sacrifice. The parents would sacrifice their firstborn(and not only!) to "gods" such as Baal and the whore Astarte. They would usually burn thw babies alive and watch their desperate movements in order to foretell the future. Sometimes they would also drink their blood. This infinite orgy had to stop.
God is the Lord and the Lifegiver. Only He creates us, only He has the right to take our bodies temporarily and only He can and will ressurect us all into eternal life. He knows what He does, why He does it. Most importantly, He does everything because of His Love for us. It would obviously be worse if the very very few canaanite children that weren't offered to the idols for the prevention of the Canaanites' defeat survived and grew up. After all, God just took them into His merciful arms. It would be absurd to think that He made them feel the pain of death. If He were such a sadist, He wouldn't have accepted to sacrifice Himself for us and to feel so much pain and humiliation because of His Love for us sinners... We ought to trust Our Lord and His Love.
Sometimes, the Israelites were commanded to kill all the livestock of the conquered Canaanite villages. God didn't want the Israelites to be greedy and to take advantage of the other tribes. Of course, the same thing Isaid previously about pain applies here too.
If you want proof for the wickedness of the Canaanites take a look at these passages:
Genesis 19:4-5
Leviticus 18
Leviticus 20:1-2
Deuteronomy 12:30-31
Deuteronomy 18:9-12
4 Kings(2 Kings) 3:27
4 Kings 16:3
Psalms 105:34-46
Jeremiah 19:4-5
Wisdom of Solomon 12:1-10