Why does God not crush and eradicate all sin when we become his people by regeneration and adoption? Why must we struggle against sin all our lives? Paul descibes and laments this fact in Romans 7 and 8 at length.
Seems to me the typology of Israel on entering Canaan has real relevance: “Neither did Manasseh drive out the inhabitants of Bethshean and her towns, nor Taanach and her towns, nor the inhabitants of Dor and her towns, nor the inhabitants of Ibleam and her towns, nor the inhabitants of Megiddo and her towns: but the Canaanites would dwell in that land.(Judges 1:27)
“And an angel of the Lord came up from Gilgal to Bochim, and 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.
2And ye shall make no league with the inhabitants of this land; ye shall throw down their altars: but ye have not obeyed my voice: why have ye done this?
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.
4 And it came to pass, when the angel of the Lord spake these words unto all the children of Israel, that the people lifted up their voice, and wept.(Judges 2).
Now these are the nations which the Lord left, to prove Israel by them, even as many of Israel as had not known all the wars of Canaan2 Only that the generations of the children of Israel might know, to teach them war, at the least such as before knew nothing thereof;3 Namely, five lords of the Philistines, and all the Canaanites, and the Sidonians, and the Hivites that dwelt in mount Lebanon, from mount Baalhermon unto the entering in of Hamath.4 And they were to prove Israel by them, to know whether they would hearken unto the commandments of the Lord, which he commanded their fathers by the hand of Moses (Judges 3).
The remaining peoples, like our sins, are there to test us and keep us humble, dependent and gowing in our covenant relationship with our Lord and Saviour. We overcome by faith which works by love in obedience to the Word. Ultimately it is the will of God and glorifies his grace in our fight and perseverance.