Ezekiel 36:22

Therefore say unto the house of Israel, Thus saith the Lord GOD; I do not this for your sakes, O house of Israel, but for mine holy name’s sake, which ye have profaned among the heathen, whither ye went.

God restores Israel not for their sake, not because they deserved it, and not because of their merit or righteousness, but for the sake of His own holy name. That name had been profaned and dishonored among the nations and before the world, for His people by disobedience had not always done right. Their bloodshed and idolatry brought judgment upon them in exile and disgrace, and their conduct led the nations themselves to dishonor God.

To vindicate His name He would gather His people, cleanse them from sin and from idols, give them a new heart and His Spirit, and lead them to obey Him. That restoration also includes restoring their land. Through this restoration He displays His holiness before the nations and shows them that He is the Lord, and His continued preserving and prospering of His people keeps His name from being dishonored in the world.

His promises to His people are meant to bring glory to Himself and are an expression of His mercy. That mercy does not excuse their sin, for the people are to recognize their former evil ways and loathe them.