Not because I enjoy it or because I want to gloat. Well, I do, but that's not the reason I tell them.
I do it because if I've had a long and heated dispute with someone, and I turn out to be right, they're probably going to "forget" that I told them so, and they're probably going to "remember" that they thought all along it would turn out that way.
I know you're not supposed to tell people that you told them so, but if you don't then very often they won't learn from the experience.