The Confession says in 1689.4.1 (On Creation) that, it pleased God the Father, Son and Holy Spirit, for the manifestation of the glory of his eternal power, wisdom and goodness, to create or make the world and all things therein…
So God did it for his glory and for the revealing of his glory. His glory is defined as his eternal power, wisdom and goodness as being on display. Creation demands a response. A response that acknowledges that God did it and in his creation we see the glory of our glorious God shining forth. This demands worship in response. In giving God the glory, we worship him. And we can focus on his power, wisdom and goodness, not limited but eternal.
The final words of the statement end with, “and all very good.” A fitting end for why God did it. He did it because it was good to be done and was good in the doing of it.