It is not evil that an attacker gets killed. It is a result of protecting from an deadly force attack.
It is just and moral to defend the innocent.
It would be better to not be attacked and have to defend oneself, or others, but this is the direct result of the attackers choice to attack.