It's called good sportsmanship.
It was a good game, whether you won or lost.
But if you played horribly bad, or if your opponent played like your granma (the one who can t understand what is a "remote controler" for her TV), do you say "GG" ? It's not good sportsmanship, it's just a lie.
If you say "GG" when the winnig was really close, it's like a mark of respect for your opponent. Something like "I don't care about winning, loosing, or anything less. That was a great moment. Thanks for this".
"GG" has lost all of it meaning for me.
PS : Sorry for my bad english = /