One has the sole effect of making humans healthier. The other is linked to far too many things to predict the outcome of. Considering dragonfly nymphs have mosquito larvae as a stable food source, it's safe to say that knocking them out will probably affect them. Then follow that food chain up (and down) and things start to get complicated.
That aside, millions of human deaths (annually or in total) is a horrific tragedy, but if we, say, managed to render a large area of land uninhabitable through ecological collapse for a generation or more, it might be far worse, both in some imaginary absolute scale, and for the people directly displaced.
Now, if you can eliminate the malaria within the mosquito, that's something else entirely.
Perhaps this is observational bias from your part? Human brain detects negatives far easier than positives.
The world is a complex place, and any action that has externalities likely creates both negative and positive ones - and for some people even same effects can be negative for some and positive for others.
Yes, bad things can happen for anyone. Generally, though, I would say deeds of compassion breed compassion.