The grace of God is clear even here in these most difficult passages. God does mighty wonders to rescue His people, and He wants as many as possible in heaven. God did everything He could to bring the Canaanites to a knowledge of Him. However, because of their depths of evil, God’s love as well as His justice had to bring consequences. But even in those consequences and extreme measures, God was seeking their redemption as well, just like the plagues on Egypt led many Egyptians to choose to follow God and leave with the Israelites, and just like the exile for Israel led them to return to God as well. God has mercy for thousands of generations (Exod. 34:7), and brings even nations like Assyria to repentance (Jon. 3–4). Many of the prophets who we think of as preaching only to Israel also had messages of warning for other nations that came after the Canaanites, and it appears that at least some of those people turned to God as a result as well.
The Canaanites knew about Yahweh and what He had done for Israel, that He was the true God and all powerful. In fact, Rahab’s statement of faith and realization that God was giving the land to Israel (Josh. 2) actually was one of the reasons that Israel had courage to go forward into the land. And then Rahab married a prince in Israel and became the progenitor of David, through Boaz (Matt. 1:5)! God does not look at ethnicity but at faith in Him, and at least some Canaanites turned in faith to God and became faithful followers even though their nations were punished.
Yahweh knows the hearts of people, and this is part of His love as well. The most powerful part of this story is that the consequences for the Canaanites are connected to the covenant curses, just as they were for Israel four hundred years later. But the covenant curses are optional, and no one has to experience them as a final death sentence for eternity. The Messiah takes the covenant curses on Himself! When we choose to accept God’s grace for us, He pays the penalty that we deserve. The punishments that come on the suffering Servant in Isaiah 53 are straight from the covenant curses, but the innocent Messiah takes them on Himself so that we can be saved and live with Him eternally. This promise is for all, Canaanite or Israelite, Christian or pagan. Amen and amen!