“Everything happens for a reason” is something well-meaning but misguided folks say to someone who’s just suffered a loss in an attempt to either make that person or themselves feel better about tragedy. IMO, it’s short-sighted and belies a total lack of thought or introspection, but it is well-meant. So I tend to give it a pass, even though I honestly think it’s one of the most horrible things you can say to someone else. The people who tend to say such things have never experienced a real loss or tragedy, IMO.
I agree with the thought up above that everything happens for a reason, but not always for a purpose.