Well, that's kinda the thing. If something was in one of those history courses, then they were important enough that it mattered.
Playing into the Santa Claus lie with your friend's kid is absolutely inconsequential to you, but it could mean a lot to that kid (and to the parents) to keep that lie alive a bit longer. (And if telling the truth to that kid, against what the parents would wish, is that important to you, I'd suggest you re-examine your priorities.)
Context matters! Sometimes being right is essential to making some important thing work out. But hey, sometimes being diplomatic (and allowing the other person to be wrong) also can be essential to make some important thing work out. The big thing is knowing the difference and acting appropriately, which is sometimes hard to do in the moment.
But if we're talking about a kid believing in Santa Claus, and the parents actually do care that you keep up the fantasy, you actually are an asshole if you tell the truth, no question. If the parents really don't care, sure, go nuts... though if they didn't care, I'd expect the kid to already know the truth anyway.