[written on 07 Dec 2014]
The claim that the actual world is the best of all possible worlds is the central argument in Leibniz’s theodicy, or his attempt to solve the problem of evil. Thomas Aquinas answered differently.
«I respond. It should be said that, according to the Philosopher in 11 Meta., the good of the universe consists in a twofold order; namely in the order of the parts of the universe to one another, and in the order of the whole universe to the end, which is God; as also there is in an army an order of the parts of the army to one another, according to the different duties/offices, and there is an order to the good of the leader, which is victory; and this order is chief, on account of which it is the first order.
And he continues:
Taking, therefore, the good of order which is in the parts of the universe to one another, it is able to be considered either with respect to the ordered parts themselves, or with respect to the order of the parts. If with respect to the parts themselves, then a better universe is able to be understood to come about, either through the addition of more parts, namely so that there would be created many other species, and there would be completed many grades of goodness which are able to be, since even between the greatest creature and God there is an infinite distance; and thus God would have been able, and would be able to make a better universe: but that universe would have itself to this [universe] as whole to part; and thus it would neither be entirely the same, nor entirely different; and this addition of goodness would be through the mode of discrete quantity. Or a better is able to be understood to come about as it were intensively, as all its parts having been changed into better [parts], because if some parts were improved, others not having been improved, there would not be so much goodness of order; as is clear in a lyre, which if all the strings were to be improved, a more pleasant harmony comes about; but only certain ones having been improved, dissonance comes about. But this improvement of all the parts either is able to be understood according to accidental goodness, and thus there would be able to be such an improvement by God, its same parts remaining and the same universe; or according to essential goodness, and thus also it would be possible for God, who is able to fashion an infinite number of other species. But thus they would not be the same parts, and as a consequence neither the same universe, as is clear from the things said previously. But if there be taken the order of parts, thus there is not able to be a better [universe] through the mode of discrete quantity unless addition in the parts of the universe were to occur; because in the universe nothing is inordinate: but intensively there would be able to be a better [universe], the same parts remaining with respect to the order which follows accidental goodness: for as much as something overflows in a greater good, so the order is better. But the order which follows essential goodness would not be able to be better, unless other parts, and another universe were to come about. Similarly the order which is to the end, is able to be considered either from the part of the end itself; and thus it would not be able to be better, namely so that the universe would be ordered to a better end, as nothing is able to be better than God: or with respect to the order itself; and thus according as there would increase the goodness of the parts of the universe and their order to one another, the order to the end would be able to be improved, for this reason, that the nearer they would have themselves to the end, so much more would follow the similitude to the divine goodness, which is the end of all [things].» 
In Summa Theologiae Ia, Q. 25, art. 6, «Whether God can do better than He makes» , he touches the same topic, and of particular note is obj. 3 and his response:
Objection 3. Further, what is very good and the best of all cannot be bettered; because nothing is better than the best. But as Augustine says (Enchiridion 10), “each thing that God has made is good, and, taken all together they are very good; because in them all consists the wondrous beauty of the universe.” Therefore the good in the universe could not be made better by God.
Reply to Objection 3. The universe, the present creation being supposed, cannot be better, on account of the most beautiful order given to things by God; in which the good of the universe consists. For if any one thing were bettered, the proportion of order would be destroyed; as if one string were stretched more than it ought to be, the melody of the harp would be destroyed. Yet God could make other things, or add something to the present creation; and then there would be another and a better universe. 
My take-home messages:
- God could have created a better universe – it would have been different. But it would not have been a universe without pain and suffering, I guess.
- One good of the universe is the order within the different parts of the universe – Let’s think primarily on the planet earth and its “vital signs”, the biosphere and its ecosystems. And all the evil that happens when we humans misuse our power: destruction of ecological diversity, climate change, dysfunctional families and societes, discriminations…
- The universe is odered to its end, to God Himself. God as the ultimate goal and target of everything and everyone. If we listen to Aquinas, God is always IN his Creation but also FAR BEYOND his Creation. it never sounds like the automatism of “everything moves automatically towards the better, towards some Omega point”, some lofty evolutionary view of some of Teilhard’s followers who claim an automatism towards an always better world – and it never is tinkering “intelligent design” (God intervenes to help a faulty process where nature needs supernatural help).
- Admirable is the consistent view that Aquinas has that the world is good and is a participation of God’s goodness. All creatures are part of this goodness, all (bio)diversity just gives as a small picture of God’s overall goodness and beauty.
 Super Sent., lib. 1, d. 44, q. 1, art. 2, «Utrum Deus potuerit facere universum melius.», The translation into English is made by Timothy G.A. Wilson, Elyria, Ohio. from the Latin text. He commented“Serendipitous discoveries like this make me smile. Er, I mean, this is clearly the work of Providence….”