How can God be for us if he pursues his glory above all things?
The ultimate ground of our joy is the fact that God's chief goal is to glorify himself forever.
John Piper writes in Desiring God: Meditations of a Christian Hedonist (p. 31):
God's saving designs are penultimate, not ultimate. Redemption, salvation, and restoration are not God's ultimate goal. These he performs for the sake of something greater: namely, the enjoyment he has in glorifying himself. The bedrock foundation of Christian Hedonism is not God's allegiance to us, but to himself.
If God were not infinitely devoted to the preservation, display, and enjoyment of His own glory, we could have no hope of finding happiness in him. But if he does employ all his sovereign power and infinite wisdom to maximize the enjoyment of his own glory, then we have a foundation on which to stand and rejoice.
For additional teaching on this topic see the related link below for the message, "Is God for Us or for Himself?"