The thing is, He didn’t have to create anything.
It has been suggested that He created the universe as a consequence of His love, and love involves more than one party. If He is all-loving, who is there to love if He did not create the universe? Loving Himself would be narcissistic! Well, this is a problem for the unitarian Jews and Muslims but not for Christians who are Trinitarians. God is one, but He is of three persons, all three eternally in love. With the love between God the Father, God the Son, and God the Holy Spirit, there was no need to create the universe for God to love.
So why did he create the universe?
Well, the Catechism, on the first page, says that it was sheer
gratuitousness.
In any case, we’re not supposed know EVERYTHING. Mysteries of the Faith and all that.