What is the distinction between metaphysical goodness and moral goodness in the throught of Thomas.
Goodness, for Aquinas, is a transcendental quality, which means that it is found in all the categories of being. Goodness is convertible with being, which means that a thing’s goodness is its being as that is the object of an inclination, either of itself or of another thing. Thus, Aquinas explains what was a well established dictum in the Middle Ages: “the good is what everything desires.” What everything, every being, desires, i.e. inclines toward, is that it continue to be or exist. This is the most universal sense of goodness, and the sense in which everything is good, insofar as everything is a being. This, then, is a sort of general metaphysical goodness. But Aquinas says that this is goodness only in a certain respect (secundum quid). The absolute goodness of a thing (secundum se) is what is proper to it, and so if something is lacking some good which is proper to it, it has an evil since evil is simply the lack of a good that is due it. The absolute goodness of a thing is it’s perfection, i.e. it having all the being it is supposed to have.
When you turn to moral goodness, you have to realize that for Aquinas, what is moral is what reason discovers that one ought to do. Thus, morality is founded in his notion of natural law. This being so, if a human act (one done deliberately and freely) is directed by reason, it has everything it is supposed to have. To be directed by reason means that that act has as its object the true good as reason discovers what that is. Good, in this sense, as the object of the will is also fundamentally absolute metaphysical goodness. Thus an act which tends toward a true good as discovered by reason is a good act. An act to preserve the being of another person which is decided upon as the result of rational deliberation would be an example of a morally good act. Thus, it is not enough that an act tend toward a good end, but in order to be a good human act, it has to involve reason and employ means which reason determines to be appropriate and thus, also good.
We must therefore say that every action has goodness, in so far as it has being; whereas it is lacking in goodness, in so far as it is lacking in something that is due to its fulness of being; and thus it is said to be evil: for instance if it lacks the quantity determined by reason, or its due place, or something of the kind.Summa Theologiae Ia-IIae, q. 18, a. 1.
What is evil?
Evil is the lack of a good that is due something, and so to understand evil, one has to understand goodness. The most universal sense of goodness is the sense in which everything is good, insofar as everything is a being. Nothing can be totally evil, for if it exists, it has some share of goodness. Absolute evil would be the total lack of good, and so would be the lack of existence, i.e. it would be nothing.
For Aquinas, God is the cause of things by causing their existence. Evil is a privation, i.e. it is the lack of some due perfection or existence in something that already has existence. There can be nothing that is “pure evil;” an evil thing is first a thing. Consequently it has some existence, and so has some good, of which God is the cause. Since evil is the lack of existence, God is not the direct, i.e. per se, cause of it; He is the cause of evil only indirectly, i.e. per accidens, insofar as He causes things to exist in which there is found some evil.
For a more complete explanation, see the essay The Nature of Evil.