langtrap

necessary evil

n.
(idiomatic) An unfavorable thing that must be done or accepted, especially because the available alternative courses of action or inaction would be worse.