Aquinas held God did not have to create (i.e. it was possible that he didn’t.) He also held God’s essence was identical to Goodness as such. Yet, in explaining why the world exists (and why some are damned), he often says things like this:
“To each things, that is befitting which belongs to it by reason of its very nature; thus, to reason befits man, since this belongs to him because he is of a rational nature. But the very nature of God is goodness, as is clear from Dionysius (Div. Nom. i). Hence, what belongs to the essence of goodness befits God. But it belongs to the essence of goodness to communicate itself to others, as is plain from Dionysius (Div. Nom. iv). Hence it belongs to the essence of the highest good to communicate itself in the highest manner to the creature.”
Thus if God is his own nature and his nature is goodness and it is the nature of goodness to diffuse itself, God necessarily creates and Aquinas is inconsistent.