Simple -
some evil is there to refine us (refined in the fire etc.) ~ pride is torn down by humbling someone, materialism is put in it's proper place by taking away material goods, sexual immorality is punished with heartache fatherless children etc.... consequence for one's actions are often called evil, when consequences are really there to refine a make us into better people.
some evil is there so that we can have pity and empathy for those who are being refined.... we all have issues to overcome, no one is perfect, rather than looking down on someone who is struggling with this or that consequence, sometimes "good people" experience similar trials to "not-yet-refined" people. Walk a mile in another's shoes to know them so you can best help them - so we all experience health issues, loss of loved ones, persecution, natural disasters etc. etc. that help us have compassion on others who experience the same things. Evil is the great equalizer.
the atonement is the ultimate example of "why bad things happen to good people" - Jesus was good, and bad things happened to him, the point of it? he felt our pain, and was therefore able to have compassion and understanding of us.
some evil is there to give us appreciation for what is good.
Who appreciates good food the most? Some who has been starving, or someone who has lived in the lap of luxury their whole life? "You don't know what you've got until it's gone", "absence makes the heart grow fonder"... opposites define one another, we know what light is by comparing it to something dark, we know what good is by comparing it to something evil. Good and evil, right and wrong, left and right, up and down - these are all relative terms that do not exist without one another.
Free will - would not exist if we were not given the freedom to choose evil actions.
etc. etc.