So God was angry with Joshua for not killing all the peoples of Canaan? This is certainly some startling news to me, since it was God Himself who helped Joshua keep the Gibeonites alive [Josh 10:1-15] -- even held back the night so that Joshua would have plenty of light to accomplish this. And far from being a bother to Israel, the Gibeonites became their obedient servants forever [Jos 9:22-26]. This would be a strange way indeed for God to express displeasure that some Canaanites were spared, no?
Of course, there were others in Canaan who continued to live among the Israelites after the conquest, but where did you get the notion that this was punishment for Israel? And what evidence is there, beyond idle conjecture, that Israel's present-day enemies can trace their ancestry to those people?
Here it is from Judges, Book 2:
2:1 And the angel of Jehovah came up from Gilgal to Bochim. And he said, I made you to go up out of Egypt, and have brought you unto the land which I sware unto your fathers; and I said, I will never break my covenant with you:
2:2 and ye shall make no covenant with the inhabitants of this land; ye shall break down their altars. But ye have not hearkened unto my voice: why have ye done this?
2:3 Wherefore I also said, I will not drive them out from before you; but they shall be as thorns in your sides, and their gods shall be a snare unto you....
2:20 And the anger of Jehovah was kindled against Israel; and he said, Because this nation have transgressed my covenant which I commanded their fathers, and have not hearkened unto my voice;
2:21 I also will not henceforth drive out any from before them of the nations that Joshua left when he died;
2:22 that by them I may prove Israel, whether they will keep the way of Jehovah to walk therein, as their fathers did keep it, or not.
2:23 So Jehovah left those nations, without driving them out hastily; neither delivered he them into the hand of Joshua.
3:1 Now these are the nations which Jehovah left, to prove Israel by them, even as many of Israel as had not known all the wars of Canaan;
3:2 only that the generations of the children of Israel might know, to teach them war, at the least such as beforetime knew nothing thereof:
3:3 namely, the five lords of the Philistines, and all the Canaanites, and the Sidonians, and the Hivites that dwelt in mount Lebanon, from mount Baal-hermon unto the entrance of Hamath.
3:4 And they were left, to prove Israel by them, to know whether they would hearken unto the commandments of Jehovah, which he commanded their fathers by Moses.
3:5 And the children of Israel dwelt among the Canaanites, the Hittites, and the Amorites, and the Perizzites, and the Hivites, and the Jebusites:
3:6 and they took their daughters to be their wives, and gave their own daughters to their sons and served their gods.