I answer that, Just as sin consists in man contemning God and adhering to mutable things, so the merit of a virtuous act consists in man contemning created goods and adhering to God as his end. Now the end is greater than that which is directed to the end. Therefore if a man contemns created goods in order that he may adhere to God, his virtue derives greater praise from his adhering to God than from his contemning earthly things. And so those, namely the theological, virtues whereby he adheres to God in Himself, are greater than the moral virtues, whereby he holds in contempt some earthly thing in order to adhere to God.
Among the moral virtues, the greater the thing which a man contemns that he may adhere to God, the greater the virtue. Now there are three kinds of human goods that man may contemn for God's sake. The lowest of these are external goods, the goods of the body take the middle place, and the highest are the goods of the soul; and among these the chief, in a way, is the will, in so far as, by his will, man makes use of all other goods. Therefore, properly speaking, the virtue of obedience, whereby we contemn our own will for God's sake, is more praiseworthy than the other moral virtues, which contemn other goods for the sake of God.
Hence Gregory says (Moral. xxxv) that "obedience is rightly preferred to sacrifices, because by sacrifices another's body is slain whereas by obedience we slay our own will." Wherefore even any other acts of virtue are meritorious before God through being performed out of obedience to God's will. For were one to suffer even martyrdom, or to give all one's goods to the poor, unless one directed these things to the fulfilment of the divine will, which pertains directly to obedience, they could not be meritorious: as neither would they be if they were done without charity, which cannot exist apart from obedience. For it is written (1 Jn. 2:4,5): "He who saith that he knoweth God, and keepeth not His commandments, is a liar . . . but he that keepeth His word, in him in very deed the charity of God is perfected": and this because friends have the same likes and dislikes.