God did not “have to” create the world, because this term applies to physical causation which did not operate; nor did he “want to” create it, because it falsely supposes teleological causation. The world was not caused in either of these two ways. It was caused through the diffusion of divine goodness into being. In other words, these statements are true only in the sense of indicating the correct causal level. It’s true that God did not have to create, but only because creation did not occur through physical causation; He did not want to create, because the it did not occur through teleological causation.
For example, the dismissal of teleology should immediately be seen to be justified when we wonder what moved, as in gave an incentive to, the first mover to thrust Himself into the action of creating. Is it not a given that God is perfectly happy? Then what was allegedly missing in His life that He needed to remedy this void in His heart by creating us? Why did God not continue to live free from care and enjoy his eternal life 100% quite without a distraction as bothersome and irritating as this world?
This does not entail that the world is necessary. For one, on the 3rd level, all such terms are meaningless. It is senseless to ask what God was doing prior to creation and what at some particular moment in time inclined Him to command that let there be light.
The notion of time does not apply to 3rd-level goodness, either, though the triune 2nd-level God is eternal, as in combining in Himself the unified simple perfection of past, present, future, and timelessness. As I argue regarding the “awakenings” of the persons of the Trinity, the Father never lacked His ad extra will and power, as per how Goodness arranged it. The Father’s life had no momentous events in it like the Incarnation was for the Son. The intellects of all three persons were fully awake from the beginning, but the Father is logically first, since His natural knowledge precedes the Holy Spirit’s middle knowledge and the Son’s free knowledge in the order of employment during the act of creation.
The world is contingent, because the Son chose of His own free will wisely as “logos” or reason which possible and then potential world pleased Him the most, having considered the data provided by both the natural and then middle knowledge.
As a corollary, the Son’s freedom to choose a world to actualize entailed His freedom not to choose any world at all and so abstain from creating.
Nevertheless, we were always in eternity meant to be. Goodness was going to create the world at the “outset.”