This answer will not make an in-depth exegesis of the Ezekiel passage you quoted, but will give you the Old Covenant background idea behind the Text. The only thing I will mention about Ezekiel, in general, from the little that I’ve read of it, is that it is a post-exilic Book. Therein, the Babylonian Exile already happened, wherein the “House of Judah,” which consisted of the Tribes of Judah and Benjamin, as well as the non-territorially alloted priestly class and their assistants, the Tribe of Levi. The 10 northern tribes, “the House of Israel,” mostly was already deported to Assyria, and most of its peoples, whether home in the Samaria/Gallilee region, or abroad, were already long ago interbred with gentile peoples to so great an extent that any notion of “Israel” and the “covenants of God” were wiped from their memory. This bears important interpretative weight on Ezekiel’s words here addressed to the “House of Israel.” While many will be quick to point out that the only surviving tribes, from the House of Judah, would, from now on, be all that remained of the original Israel, and, therefore, be called “the House of Israel,” I’m not totally convinced of this since the prophets continually promise the full restoration of the original Israel, and, therefore, the return of the 10 tribes. Ezekiel, then, may be shouting out not to Judah, but to their whole history of failure, to every Israelite (and this is important in regards to the gentiles, since many Israelites became gentiles).
Having said that, this idea of the restoration of a people long lost, by none other than the Messiah Himself (called the “Branch” or, in Hebrew, “Netzer”, which is related to “Nazarene”, as well as to the idea of “fruit” and “branches” in Ezekiel 36:8), which was depicted in terms of a “resurrection” (I think as well within Ezekiel, but correct me if I’m wrong), may be behind this passage. And so are many other important ideas. The idea of God “acting for the sake of his Name and not for Israel” can be traced back all the way to the golden calf fall of Israel. Although the original Israel was supposed to be a “kingdom of priests,” and, therefore, both royal and priestly, for the sake of being “a light to the gentiles,” the Israelites lost this firstborn elected status among the nations following their idolatry with the golden calf, having broke the original Mosaic Covenant. While, prior to this, they were to be briefly quarantined to be weaned from Egyptian idolatry (to which they were addicted), and then to be priests to lead the gentiles to God, after the calf, they were much further separated from anything closely related to “gentile.” The fulfilment of God’s Covenants with Moses, as well as Moses’ own Secondary Covenant of Deuteronomy, however, took place through David and Solomon, with King Solomon being called the priestly firstborn “Son of God.” Israel’s lost vocation was reconfigured and restored in his own unique person. Solomon, originally was a light to the nations, leading them to the truth, as well as into covenant with Israel, but he became a syncretistic idolator toward the end of his life, and his son split the International Kingdom, resulting in the 10 northern tribes and the 2 southern tribes. Throughout this whole process of failures, whether it be Israel’s in the desert, or Solomon and his sons’, God’s Name (related to his original Covenant with Moses to lead all nations to the truth) was said to be “blasphemed/prophaned/desecrated.” God’s Name was also said to be “blasphemed” because of the fact that the Temple was originally the place at which Solomon taught the gentile nations the Wisdom of God, but was later the sight of idolatrous worship alongside of the worship of God (syncretism), and was, finally, overtaken by the gentiles. That Temple which was originally the place all peoples “put to death” their false gods of ancestor and demon worship in favour of the high God of Heaven, which was supposed to be permanent, had now become a byword among the nations. In other words, what good did Israel’s lost vocation restored under the Davidic Kings as well as the Temple do to inspire wonder and praise in the gentiles, when Israel, its kings, and its liturgies failed again? Thus was God’s Name “blasphemed” among the gentiles, who mocked the whole thing, having now lost all trace of any trust in it.
Therefore, “not for your sake” and “but for the sake of my Holy Name” should be interpreted accordingly. God was always acting through Israel, and, later, specifically, through the Davidic Kings, and, finally, through the victorious True Messiah, Jesus, for the sake of all peoples (the end of Ezekiel 36 actually predicts the promise and success of the New Covenant, as well as baptism). With Jesus as the True Son of God (as eventual successor to Solomon/the New reconfiguration of Israel in his Person), as well as the Temple Himself), the original glory of Jerusalem to which the gentiles streamed in to see, and wherein the Israelites rejoiced, is brought back again and surpassed in excellence. This was the point of God working for “the sake of His Holy Name.”