This is an oversimplification. If used as a limited last resort it can do more good than harm (which is why e.g. the WHO still recommends using it). DDT is very effective and has certainly saved a lot of lives by preventing malaria infections. But if used carelessly it can do a lot of harm, and various groups of experts who have studied the question have come to the conclusion that its use should be dramatically curtailed, and replaced where possible by other methods of malaria control.
DDT causes fertility problems, birth defects, cancer, etc. to humans, as well as environmental damage.
(Malaria also kills a ton of people, and we should be investing more resources in fighting it, ideally without resorting to heavy DDT use.)
I am not a medical expert, just passing along what I have read.