Read Deuteronomy 9:5 Using Other Translations
Not for thy righteousness, or for the uprightness of thine heart, dost thou go to possess their land: but for the wickedness of these nations the LORD thy God doth drive them out from before thee, and that he may perform the word which the LORD sware unto thy fathers, Abraham, Isaac, and Jacob.
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 before you, and that he may confirm the word that the LORD swore to your fathers, to Abraham, to Isaac, and to Jacob.
It is not because you are so good or have such integrity that you are about to occupy their land. The LORD your God will drive these nations out ahead of you only because of their wickedness, and to fulfill the oath he swore to your ancestors Abraham, Isaac, and Jacob.