Well, everything does happen for a reason. It's just that the reason everything happens is the causal event immediately preceding it, and nothing else. But that's never how those people mean it, and its a shitty thing to say.
Suffering is not by definition imbued with purpose. That's why rational people try to avoid it.
I actually really hate hearing "the enemy of my enemy is my friend." Sometimes it works, very often it doesn't. Quite often, the enemy of your enemy hates your idiotic face too. It's why we have the term "Third World."