In 1981 a Jewish Rabbi by the name of Harold Kushner wrote a Book entitled The Problem of Evil: When Bad things Happen to Good People. Of course, the implied question was why do these bad things happen to good people. This same question underlies the story of Job in the Bible. Job considered himself to be a good person and was therefore considered his adversity to be unjust. His so called friends assumed that Job was a secret sinner and that his suffering confirmed that his goodness was a sham. Though the two views of Job, his and that of his friends were the opposite, the same basic assumption lay behind both opinions- good people should not suffer.
I don't really want to deal with the issue raised in this book but rather to ask a somewhat related but different question. Why do good people do bad things? Any of us, who consider ourselves among the good people or who have observed those we judge as good, know without a doubt that the best among us can and do behave very badly on occasion. What accounts for the universal mixture of good and bad behaviors in which we all participate?
The idea that the Devil made me do it is an appealing answer to this question. This traditional answer suggests that bad behavior is an anomaly, something we should never have experienced as humans beings. In this view man was created never to experience the adversity which we face, both natural and manmade. If, however, we conclude that human history has unfolded just as God foresaw and therefore purposefully allowed, then we seek a purpose behind the evil we experience.
Aside from the issue of why we all behave badly, we also deal with our definition of personal goodness. Who are the good people who should not suffer because they are good? In applying a label to people, the tendency is to apply some measure of evil to specific acts, then try to add up the sum of evil committed, and assign some threshold of total evil beyond which a person cannot be judged as good. This type of thinking quite often sets the evil threshold at some point above which I judge myself to be, such that I am numbered among the good and conveniently anyone who harms me is bad.
Such thinking is diametrically opposed to the teaching of Jesus and the New Testament Scriptures as has been noted countless times before. There are none that doeth good, no not one (Romans 3:12).
The question of why evil exists remains, but the idea that we should compound the issue by dividing humanity up into those who deserve evil and those who do not, is thoroughly debunked by the Bible. Every last one of us is a flawed human being experiencing good and bad and behaving well and not, as our state of mind and emotion fluctuates. those fluctuations exist for a variety of reasons, reasons unique to each individual because of both nature and nurture.