This is probably the most asked question by "seekers" and "young" Christians. Well, even seasoned veteran Christians may ask that same question! There are several reasons why these things happen and none of them are "that God just doesn't care!"
The first thing we need to realize that none of us are "good." We all have sinned and fallen short of the glory of God. How do I know? The Bible says so. So, the first thing we need to realize is that no matter how good we think we are, we are not good! That being said, let us look at the reasons that bad things happen to "good" people. First, personal sin. It may not be your own personal sin that does you in, it could be that of someone else (a drunk driver hits and injures or kills an innocent person.) The second is corporate sin (think of the Tower of Babel.) The third is Satanic influences. Satan is alive and well and seeking to discourage and dishearten the people of the world (especially those of us who claim Jesus as our Savior.) The final reason that bad things happen is to allow for God's providence. When we are discouraged or disheartened, we are more open to God's leading. In fact, in Luke 13 Jesus tells his listeners that the bad things that had happened recently were a wake up call for everyone to repent!
We live in a fallen world. We will be subject to bad things happening as long as we dwell here. The Good News is that when we finish the race, we will live eternally with nothing but good happening! So, don't be discouraged if you are going through bad times (and if you aren't, just wait, you will!) God is in control and the best is yet to come!