Why are Bad Things allowed to happen?
God (gods, goddesses, whatever) could have created any one of an infinite number of universes. Unfortunately he (she, etc) realises that all of them involve Bad Things happening. Fortunately he can tell which possible universe is the Least Bad. This is the one that he creates. He doesn't interfere in the day-to-day (or eon-to-eon) running of the universe because he already knows how it plays out. There are plenty of bigger problems to which to apply his infinite omniscience.
Or the universe happened all on its own at random.
Either way, humans (during breaks between eating and reproducing) try to grasp What's Going On. The finite contemplates the infinite. Unsurprisingly, this does not go well. We don't get it, and we hate that we don't get it. We can do all those clever technological things and appreciate the arts and be kind to small animals and make scientific discoveries, but none of this stops the nagging feeling that there's something bigger going on that we don't understand, which might explain why earthquakes and terrorism and disease happen (please?). Some people codify their intuitions about What's Going On into religious beliefs, and others deny that there can possibly be anything "going on".
I'm no nearer knowing What's Going On, but I can see why it's hard to know.