Deuteronomy 9:5

5 Not for thy righteousness, or for the uprightness of thy heart, dost thou go in to possess their land; but for the wickedness of these nations Jehovah thy God doth drive them out from before thee, and that he may establish the word which Jehovah sware unto thy fathers, to Abraham, to Isaac, and to Jacob.

Deuteronomy 9:5 In-Context

3 Know therefore this day, that Jehovah thy God is he who goeth over before thee as a devouring fire; he will destroy them, and he will bring them down before thee: so shalt thou drive them out, and make them to perish quickly, as Jehovah hath spoken unto thee.
4 Speak not thou in thy heart, after that Jehovah thy God hath thrust them out from before thee, saying, For my righteousness Jehovah hath brought me in to possess this land; whereas for the wickedness of these nations Jehovah doth drive them out from before thee.
5 Not for thy righteousness, or for the uprightness of thy heart, dost thou go in to possess their land; but for the wickedness of these nations Jehovah thy God doth drive them out from before thee, and that he may establish the word which Jehovah sware unto thy fathers, to Abraham, to Isaac, and to Jacob.
6 Know therefore, that Jehovah thy God giveth thee not this good land to possess it for thy righteousness; for thou art a stiffnecked people.
7 Remember, forget thou not, how thou provokedst Jehovah thy God to wrath in the wilderness: from the day that thou wentest forth out of the land of Egypt, until ye came unto this place, ye have been rebellious against Jehovah.
The American Standard Version is in the public domain.