This is a powerful question: If God is good, loving and all powerful, why is there evil in the world?
Other versions of this question could be:
“Why does a loving God allow bad things happen to good people?”
“Why does a loving God allow innocent children to get hurt or contract severe illnesses?”
The logical answer (which I admit is a little emotionally unsatisfying) is found in Genesis:
Genesis 1:26 King James Version (KJV)
26 And God said, Let us make man in our image, after our likeness: and let them have dominion over the fish of the sea, and over the fowl of the air, and over the cattle, and over all the earth, and over every creeping thing that creepeth upon the earth.
Man is in charge of this planet. We are free to make decisions, good or bad, concerning ourselves, all animals and the earth itself.
If someone makes a bad decision, that has consequences for the rest of us. For example, if our ancestors wiped out the Tasmanian Tigers (which they did), we and every single human going forward won’t be able to see live Tasmanian Tigers anymore. It’s a world of consequences.
If you’re looking for a more emotionally satisfying response, watch Nabeel Qureshi answer this question.