Having a patent does not give someone the right to actually make the patented item. It only gives them the right to try to stop others from making it. If you think something is harmful and no one should be doing it, that is not a patent issue. If company A has a patent and there is nothing in their way of making it, company A only can do it. All things being equal, without the patent anyone could make it. I don't think that helps anything, from your perspective.
Regarding using this in a defense, no. And it is a somewhat illogical question in that the infringer would actually be doing the "bad" thing to wind up needing a defense.
At one time the USPTO wouldn't grant patents for gambling machines under the theory they were immoral. Nothing in the law gave them the right to decide what was moral and after a court case the practice was ended. In Europe there are provisions in patent law regarding withholding patents from things that "violate public morality". In my opinion that is a mistake because it is so vague and capable of misuse and changing with politics. In the US if is not a nuclear weapon, cloning a human, or a human hybrid, its fine.