I think it's just how he is and how he copes on court. Doesn't seem to put him off, often seems to fire him up if anything.
A lot of players probably feel the same as him, but have learnt to keep a lid on it. Apparently Federer was a right brat as a junior. It's (usually) a waste of energy and distracting. Most players want to remain utterly focused. But for a rare few it seems to work a bit.
I remember Sampras talking about playing doubles with McEnroe in Davis Cup and how he couldn't believe at one of the change of ends McEnroe was still chuntering to him about some line call that occured a few games previously