Is there a word to describe something that is bad/harmful, yet needed/imperative?
Almost all aspects of life entail risk. We do risk to benefit analyses (albeit very poorly in most cases) and decide what is an acceptable risk, overall beneficial, an acceptable hazard, a comparative necessity, a calculated risk, a valid risk, a net positive (merit assessment), etc.
All these seem clumsy to me compared to overall positive risk-to-benefit ratio, or, colloquially, a necessary evil, or even a mixed blessing.
Deciding to use pesticides we have to take the bad with the good of it.