It is something I have implicitly understood but is made explicit by YouTuber lengthyounarther.
His video on Stefan Molyneux (above) makes the point that an argument in favor a well-reasoned political theory must take into account the practical consequences of acting on the basis of that theory. While someone judging the validity of libertarianism may agree that aggression is wrong, one objection is that it is at least conceivable that failing to commit aggression in a certain instance could, even by libertarian standards, result in a worse state of affairs.
That is precisely the objection being made when someone states a particular act is a necessary evil, that some level of evil is necessary now to ward off a more extensive occurrence of evil later. For example, some argue that taxation for funding the police is regrettably necessary to prevent greater violations of people’s rights from taking place by private criminals. The argument for a moral or political concept, like the non-aggression principle, that is made devoid of its practical effect is insufficient to handle that objection.
I do not buy into the line of thought that evil is necessary. To realize why that is, we have to turn to the study of economics to understand the consequences of alternative human actions.