In ST I q5 a1, St Thomas writes:
Goodness and being are really the same, and differ only in idea; which is clear from the following argument. The essence of goodness consists in this, that it is in some way desirable. Hence the Philosopher says (Ethic. i): “Goodness is what all desire.” Now it is clear that a thing is desirable only in so far as it is perfect; for all desire their own perfection. But everything is perfect so far as it is actual. Therefore it is clear that a thing is perfect so far as it exists; for it is existence that makes all things actual, as is clear from the foregoing (3, 4; 4, 1). Hence it is clear that goodness and being are the same really. But goodness presents the aspect of desirableness, which being does not present.
The good is what all men desire. What makes a thing desirable are its perfections. A thing is perfect insofar as it is actual: there is no potency with respect to those aspects that make it desirable to us. But that which is actual is that which exists. So the good == what is desirable == what is perfect == what exists.
There are a couple interesting things about this, at least to me. First, God is perfectly in act, which means that He is the perfect and highest good; hence He ought by right to be what all men desire above all else. I’m also reminded of Proverbs 8:36, “All that hate me love death.” And Wisdom 1:12-16:
Seek not death in the error of your life, neither procure destruction by the works of your hands. For God made not death, neither has he pleasure in the destruction of the living. For he created all things that they might be: and he made the nations of the earth for health: and there is no poison of destruction in them, nor kingdom of hell upon the earth. For justice is perpetual and immortal. But the wicked with works and words have called it to them: and esteeming it a friend, have fallen away and have made a covenant with it: because they are worthy to be of the part thereof. [Emphasis added]
God created all things that they might be: they are “very good” (Genesis 1:31). So to hate God is in a crucial sense to hate goodness, and to hate existence itself. It is to love non-existence: death. This is irrational alongside being sinful.