Read Job:
Afflictions and sufferings may, as your question well demonstrates, boggle the human mind–even the mind that believes in an infinitely Loving God, but there is always a purpose being accomplished and we do not HAVE to understand fully, though we may in part.
Now read Habakkuk:
God can use terror, evil, all things, to glorify himself. He can use evil to accomplish Good. Think about it: Had Adam and Eve not partaken of the Forbiden Fruit, there would be no need for a Savior or Messiah. Hence, the ultimate display of God’s Affection never would have been made manifest in the person of Christ had it not been for the Devil’s first “victory.” Make sense?
Now, in the same way, because there* is* evil (okay, so evil doesn’t, technically “exist,” being only the privation of Good, but bear with me), this being attributed to Man’s freewill (his innate ability to choose between the two), we must therefore conclude that God shall ultimately use this corruption, as he did with our First Parents’ sin, to accomplish his end–to glorify himself, displaying his Wrath and Justice in the condemned and impenitent, his Love and Compassion in the blessed.
It’s complicated. Like I said, read Habakkuk and Job.
Never do the stars shine brighter than in the blackest of nights. Neither is God’s radiance clearer than in the most perverse of ages.