The Bible seems to give several ways of understanding God's ultimate purpose in creating the world and mankind. Surely, one way of postulating God's purpose is to say "God is foremost proclaiming and demonstrating his glory."
In the comparison Jesus made of the life of a disciple and a branch on a vine, he makes a direct tie between God's glory and bearing fruit. Fruit is a demonstration of who we follow. Fruit brings health, color, refreshment and life. So, fruit paints God positively and gives him glory. So, maintaining a connection, because it yields fruit, brings him glory. One of the basic steps in glorifying God is for his family to remain connected to him.
But it is not just the connection. The connection produces fruit. Fruit is not produced for the sake of the branch. It is good if the branch experiences health, color, refreshment and life.But fruit is for somebody else.