In one sense both the wicked and the good love themselves since both want to continue enjoying what they enjoy and avoiding what they prefer to avoid. The “self” in this sense is whatever you’ve been doing with your life until now and the consequent habits you’ve formed to define yourself, which needn’t have any relation to what you actually are. Your habitually acting as if X is true can’t make it so.
“Self” in another sense is the part of man that rules and is predominant, and here either reason rules the irrational parts or vice versa. Thomas’s argument for the goodness of the rule of reason appeals to Aristotle’s five criteria for friendship:
1.) Friendship wills the other to keep existing. Reason desires the emotions to be appropriate to the situation while emotions want reason to simply be silent or, what’s worse, to be at the service of whatever the emotion wants right now.
2.) Friendship wills good to the friend. Reason wants emotions to have their own proper goodness of being appropriate to reality and the situation since the rule of reason is in the passions as a subject. The rule of emotion wants reason to be denied its proper good of ordering all things, even emotions, to their end as emotions. The objectivity of reason allows it to know other things in themselves and so to will goods to things in themselves. Sensitive powers like emotion see things under the conditions of sensation and so as conditioned by what is good for the sentient organism.
3.) Friendship wills to dwell with the friend. Reason by its nature dwells with things in need of order, but the dominance of passion simply seeks emancipation from reason.
4.) Friendship enjoys the friend. Things enjoy their proper acts, and the proper act of sensation is to be moved by another while the proper act of reason is to set the other in order.
5.) Friends are of one mind with each other. The more reason rules emotion the more both come into their own, while the more emotion seeks to rule over reason the voice of reason becomes weaker and more latent and emotions become unruly, dissipated, and continually a seeking novelty that the world itself cannot provide beyond a point it does not take long to reach.
For a man to love himself requires (analogously) that all his parts be friends with himself, but only the virtuous can have this. Properly speaking, only the virtuous man loves himself, as is clear from Psalms 10: 6 he who loves iniquity hates his own soul.