I downvoted it, because I see it as a stupid comment for situations where something (partly) out of your control happens and you lose. "It's going to be ok" from a friend is nice then, but a comment that "Everything happens for a reason" from a stranger is just weird. Not only he agrees that the bad thing was supposed to happen, he implies that he knows there was "a greater plan" and that he has some knowledge about the whole situation that allows him to predict your future. I hate this phrase, because it's complete BS.
So yeah - downvoted for personal reasons ;)
Good luck to the guys.