Everyone who suffers a significant tragedy in their life has asked themselves this question. It doesn't matter if it is the death of a loved one, a financial setback, the loss of a job, or, as in my case, it is receiving an incurable cancer diagnosis.
Harold Kushner, a conservative rabbi addressed this question directly in his book "When Bad Things Happen to Good People" as his response to his own child's death at the age of 14. I fight with this question continually because it seems so unfair that something so bad happened to me and my loved ones.
I like to think I am a good person and I don't feel I have done anything obviously bad enough to warrant this sentence. I am a Christian and have lived my life in what I believe to be a mostly Godly fashion although I know I frequently fall short. Most people believe that if you live your life in a righteous fashion, you will be rewarded. Televangelists say this all the time, implying that giving them your money will result in you receiving rewards back N-fold (they never tell you that N is 0).
I have had people tell me that this is just part of God's plan. Oh really? Is it God's plan that I should suffer and that my wife and kids should suffer? Is it God's plan that I must retain a job that provides health insurance or drain all my retirement funds in a few short years, condemning my wife to a life of poverty after I die? Of course, I don't expect to lose my job but staying employed is always something to be concerned about in these difficult financial times.
I have had people tell me that God would not give me this disease if I were not strong enough to handle it. That is just telling me that I need to tough it out. That is telling me that, if I do feel weak, that it is just my own fault for feeling weak and I am letting God down by not bucking up. If a person has suffered a tragedy, this is not something that you should tell them. They need your support, not to be told that they need to buckle down and deal with it.
I am also a man of science and I understand how these things happen. Every single day, 400 Trillion cells are replaced in your body. Each cell has DNA that the cell has to copy and your DNA has approximately 3 billion base pairs that must be duplicated. That means that, every day, you have about one trillion, trillion copies that need to be made exactly.
When a mistake is made in these copies, sometimes it occurs in a place that doesn't matter (or it may matter when combined with another mutation). Sometimes it is significant enough that the cell cannot survive and that cell naturally dies off. Every once in a while, the error is significant and the cell is viable but your bodies own anti-body system detects the error and kills it off. Another option is that the error turns out to be useful and allows the species to improve and advance. The final option is mine. The cells are viable, undetectable to my body as bad cells, and, yet, disastrous.
Could God have prevented this error? Yup. Certainly. But to do so, he would have needed to remove a significant portion of the beauty that is evolution and violate those rules he set in motion. There are always things God could have done but he created this world with an amazing system of physics and biology and I don't believe he messes with this wonderful system he has put in motion.
Breaking the rules would make it impossible for the scientific method to work. It would mean that it is impossible for us to discover the rules that govern the world in which we live. I love rules (anyone who knows me, knows this to be true) and I believe that the God I believe in and the world I live in follow the same rules.
Bad things happen to good people and good things happen to bad people. That is not God punishing us, that is just part of the random chance of life that sucks. One person is 5 minutes late in the morning and misses a flight while another arrives 5 minutes early and gets on that flight as a standby passenger. If the flight goes down, does that mean God loves the first person and is punishing the second person (and all of his family and loved ones)?
If you have suffered a tragedy, I HIGHLY recommend reading Kushner's book. Don't believe that you are being punished. Don't believe that you must be strong enough to handle this. It is just fine to be weak and scream at God. At some point you are going to need to accept your fate and rise up to it but don't let anyone make you feel bad for any pain you feel or need to express