Notice how strongly God expresses the concept of separation from what is spiritually impure. The Canaanites, and all of the other nations that are mentioned, were to be completely wiped out on religious grounds. This is because religion has such a powerful influence on conduct.
Israel never did this, and the Canaanites were a constant thorn in their side through their false gods. Through Israel's social and business interactions with them, they were persuaded to follow the Canaanites' god's practices—even to the extent of sacrificing their children in the fire.
In order to properly understand this command to exterminate these peoples, it must be understood that, though God was their Ruler, Israel was a nation of this world. Israel was put into the place of God's avenging angels—His agents—to take vengeance on those nations. However, the key is that Israel was a nation of this world, which is something that the church is not. When Jesus was before Pilate, He said, "My kingdom is not of this world. If My kingdom were of this world, My servants would fight, so that I should not be delivered to the Jews; but now My kingdom is not from here" (John 18:36).
The lesson for us is that we are to be, as it were, this harsh with ourselves in getting rid of the sin within us. As Jesus says, "Pluck out your eye. Cut off your hand." We know that He does not mean this literally! He wants us to understand the spiritual principle that is involved. We have to be willing to go to that extent—to fight "tooth and nail" the contamination of sin that so easily besets us, which can so easily be picked up from contact with this world.
So the spiritual lesson for us is that God is equally demanding toward us—that we do not allow this world to influence us in any way that will contaminate our holiness, imputed as a result of Christ's sacrifice. Israel did not follow through, and soon no difference could be seen between them and the Canaanites. God's commands to be different make the witness and provide the means, the environment, for sacrifice.
In order to keep from being uncontaminated by the world, there must reside in us a strong measure of religious intolerance, or we will find ourselves compromising. What we call "human nature," and what the Bible calls "carnality," produced this world. It loves this world and is easily attracted to its practices and its attitudes. To attain the Kingdom of God, we cannot tolerate those things in ourselves.