And God said, “If you really heed the voice of the LORD your God, and do what is right in His eyes, and hearken to His commands and keep all His statutes, all the sickness that I put upon Egypt I will not put upon you, for I am the LORD your doctor.”  Doctors don’t heal or harm people, rather, if we follow their advice our health improves and if we disregard it then our health deteriorates. The Torah is God’s advice to us and our spiritual health depends on following the Torah’s commandments. Malbim explains that God does not punish or heal us, rather when we follow the Torah we are like a patient whose health improves because s/he’s following the doctor’s advice.