The situation of the man who takes up the sword is this:
He turns to the use of force as a last resort and therefore as a necessity, and this last resort is morally imperfect. In doing this, he does not sin, since although the use of force is morally imperfect, and therefore unrighteous, he has no other choice, given the circumstances, unless of course he were to give up resistance to evil and to surrender to it, which is not an option because this would carry him even further from moral perfection.
Here we must address the subjective condition of the man who resists evil in this way, out of necessity. The noble man does not choose this course out of a weakness of character, which is to say, from subjective unrighteousness, but due to an objective situation that only permits certain imperfect and undesirable outcomes. From among these outcomes, he salvages whatever good he can salvage, choosing the outcome which is least unrighteous, which at this point becomes mandatory for him due to his vocation, accepting that in any case he will suffer loss. This is the spiritual compromise he is called to make.
If a righteous outcome were objectively possible, and if he did not choose it due to cowardice or indifference or some subjective weakness, only then would he be culpable for the moral imperfection in which he is involved.