Take the term "evil" lightly if you wish -- it doesn't have to be the worst of the worst but instead can just be something that you don't like or support. Despite this, you also think yields value or is something you/we can't do without, which is what makes it "necessary".
The question is open to any field or topic, and any example, big or small. It can also be situational as well, rather than absolute.
A simple example for me would be flossing, which I hate doing but which is great for dental health. (This is also somewhat contrived since I actually love using my water flosser, but that's beside the point).
Explain what you chose and why you think it fits the description of "necessary evil".