Judges explains that God did not drive out the remaining nations because Israel broke the covenant and did not obey God’s voice (Judges 2:20–23). These nations would be left to test Israel and to see whether they would keep God’s way (Judges 2:22).
In Judges 2:20–23, Yahweh responds to Israel’s covenant-breaking by changing how he will deal with the remaining peoples in the land. He declares that, because Israel has not listened, he will no longer drive out the nations Joshua left behind. This section comes in the opening overview of Judges that explains the repeating pattern that will fill the book. Earlier in the chapter, Israel’s generations shift after Joshua’s death, and the people turn away; Yahweh then responds by allowing trouble and raising deliverers.
Judges 2:20–23 explains why hostile peoples remain in the land after Joshua. The text’s explicit claims are that Israel broke Yahweh’s covenant and “did not listen,” and that Yahweh responded by no longer driving out the remaining nations (verse 20–21).
A careful answer keeps the immediate passage, the book's argument, and the whole-Bible storyline together, so the question is answered in context instead of as a detached idea.
Start with Judges 2:20-23, then read the surrounding section so the answer stays connected to the passage's flow.
20The anger of Yahweh was kindled against Israel; and he said, Because this nation have transgressed my covenant which I commanded their fathers, and have not listened to my voice;
21I also will not henceforth drive out any from before them of the nations that Joshua left when he died;
22that by them I may prove Israel, whether they will keep the way of Yahweh to walk therein, as their fathers did keep it, or not.
23So Yahweh left those nations, without driving them out hastily; neither delivered he them into the hand of Joshua.