A number of major world religions subscribe to the notion that God, such as God is understood, created the world or worlds or universe and all existence. Hindu scripture specifically tells us so. In fact, in the Gita, God Himself reminds more than once.
In Chapter 9, Lord Krishna tells us that the whole world was His idea, and was born from Him. It explains that a great wheel makes it turn round and round and that it appears and disappears repeatedly because He wants it to.
In Chapter 10 He explains:
Everything comes from Me.
Truth, wisdom, forgiveness, self control,
happiness, unhappiness, bravery, fear,
peacefulness, fame and shame
all come from God.
The Gita, Chapter 10, Verses 4, 5
At the same time the very God who takes credit for creation, declares His creation to be an illusion. It is “Maya” or make believe or magic and He tells us that only fools believe that the world is real. In His own words:
The wise who understand God pass beyond
They cross over Maya and reach Me.
The Gita, Chapter 7, Verses 14
Now why would God or the sages who gave to life to the ideas embodied in the Gita create a world that is illusory only for humankind to acknowledge this truth? Why would a power like God want to create worlds that come and go?
It seems to me that the reason does not fit within human logic. It is just that this is how it is.
See The Gita, A New Translation of Hindu Sacred Scripture, by Irina Gajjar.