For Zion's sake I will not be still, and for Jerusalem's sake I will not rest, until her righteousness goes forth like brightness, and her salvation is like a burning torch [Isaiah 62:1, John Oswalt's translation (p.576)]
John Oswalt, in his commentary on Isaiah, says of this verse:
However it might appear, God insists that he will be at work unceasingly for Zion's sake. The emphatic position of this phrase Underlines a significant point. As important as God's name is, he is not delivering Jerusalem for himself, for the sake of his reputation, but for the love of his people. (Oswalt, The Book of Isaiah, Chapters 400-66, p.578)
Then he adds this footnote:
The other side of the position is given in Ezek. 36:19-27, where God makes plain that he is not delivering Israel because of anything it has done to deserve such deliverance. The deliverance is strictly an expression of his own holiness.
Here is that passage:
I dispersed them among the nations, and they were scattered through the countries; I judged them according to their conduct and their actions. And wherever they went among the nations they profaned my holy name, for it was said of them, 'These are the LORD's people, and yet they had to leave his land.' I had concern for my holy name, which the house of Israel profaned among the nations where they had gone.
"Therefore say to the house of Israel, 'This is what the Sovereign LORD says: It is not for your sake, house of Israel, that I am going to do these things, but for the sake of my holy name, which you have profaned among the nations where you have gone. I will show the holiness of my great name, which has been profaned among the nations, the name you have profaned among them. Then the nations will know that I am the LORD, declares the Sovereign LORD, when I am proved holy through you before their eyes.
" 'For I will take you out of the nations; I will gather you from all the countries and bring you back into your own land. I will sprinkle clean water on you, and you will be clean; I will cleanse you from all your impurities and from all your idols. I will give you a new heart and put a new spirit in you; I will remove from you your heart of stone and give you a heart of flesh. And I will put my Spirit in you and move you to follow my decrees and be careful to keep my laws. [Ezekiel 36:19-27, TNIV]
Here are three views that someone might hold to try to fit these texts together:
A. God does things for the sake of his glory, and God does things for the sake of his people (or those he will bring into his people). But these motivations are distinct (but at times simultaneous), and neither is wholly reducible to the other.
B. God does things for the sake of his glory, but all this means is that he acts based on his character and promotes what's good. The reason God promotes what's good is for the sake of others. So God's doing things for the sake of his glory is explainable in terms of God's doing things for the sake of others, which is the more primary and ultimate motivation for God.
C. God does things for the sake of others, but the reason God's love is important is because it demonstrates the perfection of God, the most perfect being. It's always good to promote good, and promoting the most perfect is better than anything else you might do. So God does things for the good of others because God does everything for the sake of his glory, and doing things for others does that.