In order to be moral, any act must have three good fonts of morality:
- good intention
- good moral object
- the good consequences must outweigh any bad consequences
If you kill in self-defense, the moral object is good. But the other fonts must also be good in order to avoid sin.
Also, the personal guilt or innocence of your attacker does not detemine if the moral object is good.
Examples: (1) Your neighbor on one side of the street is a very sinful man, who has publicly admitted to committing many mortal sins, and who openly states that he is unrepentant; he is guilty of many gravely immoral acts. But he never threatens you with any type of grave harm, and so you may not kill him. Though he is guilty of many sins and crimes, he is innocent of any grave aggression against you, and so to kill him would be to kill an innocent person. He is guilty of many things, but he is innocent of attacking you.
(2) Your neighbor on the other side of the street is a veritable living Saint; by all accounts he is full of every virtue, and no one accuses him of any offense. But one day, afflicted by a severe psychological illness, he attacks you with deadly force. You may morally kill him in self-defense (if there is no other way to save your own life), even though he is, as they say, ‘not guilty by reason of insanity.’ Your attacker is without any culpability in the sense of actual mortal sin; his soul and his life are innocent. But in the immediate situation he has chosen (in this case without free will) to assault your life with deadly force. He is committing an objective grave attack against you, though without the culpability of actual sin.