“Not because of your righteousness or the uprightness of your heart are you going in to possess their land, but because of the wickedness of these nations the LORD your God is driving them out from …” (v5). God warned the Israelites not to become self-righteous and proud, but to remember that they were “stubborn” people, dependent on God’s grace. The Canaanite people were idol-worshippers whose perverted sexuality and child sacrifice angered God; if the Israelites did the same, they too would be punished.
“Do not say in your heart … it is because of my righteousness” (v4). God’s mercy was poured out while we were still sinners, and therefore we are called to live in humility and gratefulness.