Why can't they spray to get rid of mosquitoes and prevent malaria?

Pick your poison. Spraying does indeed, prevent malaria- this is the reason why malaria is so rarely seen in the United States or canada these days. However, mosquito sprays don't just kill these bugs, they also affect the environment, leading to mutant amphibians and other wildlife, as well as the disruption of whole ecosystems. Importantly, just like bacteria, mosquitoes become eventually become resistant too.
Too many mosquitoes. Many researchers are trying newer techniques to rid malaria infected areas of mosquitoes. Poisoned sugar water, sterile males and other tatics are under evaluation. Simply spraying for mosquitoes is too costly for many conuntries both in $ and toxic side effects (remember ddt?). Hopefully with effective mosquito control and vaccines we'll finlally rid the world of this deadly parasite.
Side effects. Spraying and use of insecticides to get rid of mosquitoes has been tried. It can be expensive (note most countries with malaria do not have large public health budgets) and can cause side effects (remember ddt?), as well as breed resistance in the local mosquitoes. However it can also be effective. That said, curent efforts at malaria eradication are focused, excitedly, on vaccine development.

Related Questions

Can killing of mosquitoes prevent spread of malaria?

Creates Problems. The products used to kill the mosquitoes also kill off beneficial insects setting in motion some disastrous results in the past that caused more harm than good. Pesticide resistance has been another issue. Nonetheless this has been one approach that still has merit and many programs are in play internationally. The eventual ramifications remain to be seen.