Clay Jones, in this blog post, provides even more evidence that God, in the Old Testament, spares those who repent of their sin. Consider the story of Sodom and Gomorrah found in Genesis. Abraham asks God:
Will you sweep away the righteous with the wicked? What if there are fifty righteous people in the city? Will you really sweep it away and not spare the place for the sake of the fifty righteous people in it? Far be it from you to do such a thing—to kill the righteous with the wicked, treating the righteous and the wicked alike. Far be it from you! Will not the Judge of all the earth do right?
God offers to spare the cities if even ten righteous people can be found. We know how the story ends. Not even ten people could be found and both cities are destroyed. Jones writes:
The evil which seduced the people of Sodom and Gomorrah may have surprised Abraham and may surprise us, but it didn’t surprise God. Certainly we learn several things from this passage. One, Sodom and Gomorrah were completely depraved. Two, God knows hearts and therefore knows who will and who won’t repent. Three, God would allow entire cities to live if it meant that a handful of righteous wouldn’t die. Four, God was willing to give evidence of Sodom and Gomorrah’s wickedness so that He couldn’t be accused of killing the righteous with the wicked. And five, when God destroyed these cities, he only killed the wicked.
Jones then points us to the Book of Jeremiah.
The Lord warned Israel that if they let the Canaanites live that they would be seduced by their sin and then God would do the same thing to Israel. Well, we know that happened, and so the Lord sent prophets to warn them to repent—to no avail. Then the Lord said in Jeremiah 5:1-2: ‘Go up and down the streets of Jerusalem, look around and consider, search through her squares. If you can find but one person who deals honestly and seeks the truth, I will forgive this city. Although they say, “As surely as the Lord lives,” still they are swearing falsely.’
Then in verses 3-5 Jeremiah reports that he looked but that he couldn’t find anyone who would repent. So in v. 6 he concludes: ‘Therefore a lion from the forest will attack them, a wolf from the desert will ravage them, a leopard will lie in wait near their towns to tear to pieces any who venture out, for their rebellion is great and their backslidings many.’ Notice that, just as with Sodom and Gomorrah, the Lord made sure that the world would know that He knows when there are no good people in a city.
Finally, Jones points to the Book of Ezekiel.
Consider also this passage from Ezekiel 14:13-14, ‘Son of man, when a land sins against me by acting faithlessly, and I stretch out my hand against it and break its supply of bread and send famine upon it, and cut off from it man and beast, even if these three men, Noah, Daniel, and Job, were in it, they would deliver but their own lives by their righteousness, declares the Lord God.’ In the following verses the Lord says this is true when He kills with ‘wild beasts,’ or a ‘sword,’ or ‘pestilence.’
Then in v. 22 the Lord says, ‘But behold, some survivors will be left in it, sons and daughters who will be brought out; behold, when they come out to you, and you see their ways and their deeds, you will be consoled for the disaster that I have brought upon Jerusalem, for all that I have brought upon it.’ Why will the people who witnessed their destruction be consoled by seeing these survivors? In the next verse the Lord tells us: ‘They will console you, when you see their ways and their deeds, and you shall know that I have not done without cause all that I have done in it, declares the Lord God.’ Again, notice that the Lord cares that the people of that day realized that the people He had killed were depraved and deserved to die.
So what can we conclude? The Bible portrays the Canaanites as the most morally depraved individuals most of us could imagine. They are squatters on land that God has given Israel. God held Israel to the same standards as the Canaanites and He eventually pushed Israel out of the land when their sin reached a climax. Finally, we have very good reason to believe from several Bible passages that God would spare any individuals who repented of their sin and followed Him. Thus, no innocent Canaanites were killed by Joshua.