From the Angelic Doctor...
"That a man should live is good; and that a man should be killed is evil, absolutely considered. But if in a particular case we add that a man is a murderer or dangerous to society, to kill him is a good; that he lives is an evil. Hence it may be said of a just judge, that antecedently he wills all men to live; but consequently wills the murderer to be hanged."
-- Saint Thomas Aquinas (1225-74)