Why do bad things happen to good people?
As humans we tend to place a lot of purely human ideals/ideas on the non-human world, but they're all actually things we've just made up.
Goodness/badness/fairness/unfairness aren't "real things" existing in nature; they’re just something humanity has created in our minds and societies. No things has an inherent goodness or badness, we as humans just think/decide it is.
Don't get me wrong, it's essential for human well being to have such things in place, but it's not something we can subject non-conscious things to.
Gravity doesn't care, and can't care or know in any way, whether the guy soon to die from a coconut hit to his head falling from a tree was a child rapist or a humble "saint" always bringing happiness to other people.