Traditional Christian thought holds that God could have refrained from creating. But this is puzzling. Whatever God does he does for a good reason. But what good reason could there be for not creating something? Granted, God might well have good reason not to create beings capable of sin. But not all beings are like that—flowers aren't like that, and maybe there could even be finite persons that aren't capable of sin.
Here is a suggestion inspired by a remark of Mark Murphy's about how all creatures imperfectly reflect God. Think of how an artist might refrain from making a work of art on a particular subject because she thinks herself unequal to the subject. You might think that it would be good to produce a work of art that does not do full justice to the subject, since perhaps all works of art fall short, and there is something to that. But there are two kinds of reasons—to promote the good and avoid the bad—as we learn from Aquinas. And by refraining from produce the work of art that does not do full justice to the subject, the artist is acting on a good reason, though she could also be acting on a good reason if she chose to produce the work of art.
Now God's reason for creation is himself: he creates to produce something that is in his image, which thereby glorifies him. But every possible creature, and indeed every collection of possible creatures, falls infinitely far short of God. Thus whatever God creates, it will be a work of art that, necessarily, falls short of its subject. This gives God a good reason not to create anything, to refrain from producing imperfect images of himself.
Of course, there will be cases where we would think an artist excessively timorous if she refrained from producing a work of art because it falls short. But there will also be times when we would think that the artist shows a proper understanding of the importance of the subject and what she can produce when she refrains from producing. A best-selling novelist who lacks much talent in characterization, but can nonetheless produce exciting plots, should perhaps not attempt a novel on the deep moral transformation of the wife of an SS officer who watches her husband's slow decay as he is assigned to Auschwitz.
Now, paradoxically, the artistic products of the infinite God will fall infinitely short of the subject matter when he creates and he so realizes. It is not that God is capable of less than the human artist. It is, rather, that the subject of his art is infinite, and he fully realizes this infinity. A human artist—say, a poet—who writes about God faces the same problem, but lacks God's understanding of just how infinitely short the work falls of its subject. There is a hint of this in the Old Testament prohibition on images of God (a prohibition no longer literally applicable once God has become incarnate and transformed the Law).
Whenever a sensitive artist creates, there is a kind of sacrifice of the artistic sensibility—the artist makes something that she knows falls short. And so we owe special gratitude to God for creating us. He had good reason not to create, though he also had good reason to create. Where there are conflicting reasons, that is where choice is needed.