I cannot agree with the answers given. At least not if we are talking about competitive chess. To my eyes this is the most frequent impoliteness (or missing sense of sensibility) happening at tournaments, although it might not be a severe one.
In chess you usually cannot blame anybody else for your defeat. You have to cope with your inabilities all by yourself, which puts a heavy mental burden on a lot of loosing players, especially young ones. When you tell them they played a good game this implies that their play was good in respect to their (low) strength. But since they are weaker, it was clear from the start they will loose anyway. This is not what most player want to hear after loosing a game.
Back in my teens I once had a winning advantage against an experienced titled opponent. I blundered on move 38, partly because of a grave misjudgement of the arbiter two moves earlier. When I resigned on move 41, full of embarrassment and self-hatred, my opponent patronizingly claimed that I played well. Never again did I feel so badly degraded in chess.
When I tell this story, often someone comes up with a similar anecdote, usually confirming that this was a painful experience. So, don't be like this. Do not patronize your opponent after a competitive chess game. Be careful to test someone's humor when they are not by themselves, especially when your good mood resulted from an undeserved victory.