In the final analysis the questions of why bad things happen to good people transmutes itself into some very different questions no longer asking why something happened but asking how we will respond what we intend to do now that it happened.
The ability to take pleasure in one's life is a skill and is a kind of intelligence. So intelligence is a hard thing to evaluate and it manifests itself in so many different ways. I do think the ability to know how to live a life and not be miserable is a sign of that.