In ST I-II, 8, St. Thomas takes up the question of what the will wills.
The first article makes the narrow but important point that we can only will what we think is good for us. This is because goodness is existence under the aspect of desirability, and we can't want what has no existence even in thought. In particular, everything we want has to have the property of somehow suiting us (though this property may exist only in our mind).
I say it's a narrow point because it's practically a tautology: I can only desire something that I find desirable.
I say it's an important point because it can help us to understand how and why people (particularly ourselves) make evil choices. Our will operates on our apprehension of things, not on the things themselves.* To the extent we misapprehend things -- by seeing something that isn't there, or not seeing something that is there -- we are likely to will things we shouldn't or not will things we should.
The first objection to the teaching that we only will the good is that all human powers operate on opposites. Just as sight can see white and black, so the will should be able to will good and evil. St. Thomas answers this by saying that the will regards evil as a thing to be shunned. He proposes that we should speak of "volition" as the will's act of desiring good, and of "nolition" as the will's act of shunning evil (in Latin, that's "voluntas" and "noluntas").
The second objection, that rational powers can be directed toward opposite purposes, is answered by observing that the opposite purposes to which the will can be directed are things like "staying here" and "going there," but they're all desired insofar as they are good.
The third objection I've already alluded to. For a thing to be good, it has to exist, but we can want things that don't exist, or we can want to not do or not have something. St. Thomas calls such negations, privations, and future things "beings of reason;" as I put it above, they "exist only in our mind."
(Talk of "beings of reason" may strike some as a "define 9 as prime"-type dodge to excuse saying things that don't exist have existence. Actually, though, every good we will is a "good of reason," whether associated with an act or a non-act, because every good we will is a good as it exists in our own mind.)
Curiously, St. Thomas doesn't enumerate the objection I often hear, which is that people can and do will evil things because they are evil. My answer to that objection is that to will something is to desire it, and to be desired is to be perceived as good. In other words, "to desire something evil as evil" is a contradiction in terms. In the case of a person of perverse will who says he wants to do things that are evil because they are evil, then, the perversion lies in perceiving evil things as good, not in willing evil as evil.
* The will is the rational appetite; both it and the sensitive appetite** operate on apprehension. Our bodies also have what St. Thomas calls a "natural appetite," which includes such inclinations as falling in air and floating in water. The natural appetite operates, not on how things are apprehended, but on how they actually are -- Wile E. Coyote and the Roadrunner being noted exceptions. (The former's natural appetite for falling is controlled by his rational apprehension of standing in mid-air; the latter, having never studied law, never does apprehend gravity.)
** The sensitive appetite comprises the concupiscible powers of love, hatred, concupiscence, delight, and sorrow; and the irascible powers of hope, despair, fear, daring, and anger. See ST I-II, qq 22-48.