Was Sampras really kidding anyone by retiring after the US OPEN win? He was never going to win a slam again.
The point is, you don't know that. If he had retired in 2001, you probably would have said the same thing... he's finished, no chance for another one. Yet he won the USO the next year.
Sampras winning the USO in 2002 showed that, when he retired, he still had what it takes to win a Slam. The possibility that he could have won more is there, therefore you can't be sure that he had truly achieved everything he was capable of before he retired.
Contrast with someone like Hewitt, who has stuck around to the point that winning another slam is now a virtual impossibility. You know that he has wrung every drop out of his Grand Slam career. There will be no 'what if' factor when he quits.
People who want players to retire on top are mostly ones who care about record books. If you retire before you start the severe decline, your match records, H2H against rivals, etc. will all be better. Fans of the player can also say "hey, he was still pretty good, he may have achieved more if he'd stayed with it".
Players don't care much about that stuff, because for them tennis is primarily a career. Federer is still earning tens of millions of dollars a year, he is still famous, he is still in with a chance of winning big tournaments. Probably most importantly, he is also still doing a job that he is extremely good at instead of being retired and bored, doing commentating or playing a few seniors tour matches. Most pro athletes are terrified of being retired and irrelevant at 30 and still having well over half their lives ahead of them, unable to do the only thing they have ever been good at.
I think if you asked Federer (or any pro athlete) if giving up all that - and also enduring the tantalising uncertainty over whether they could have won one last tournament - is worth protecting some silly stats, they would laugh in your face. I would much rather have a full and complete career than be too proud to let someone see me in decline. Most athletes, I think, would be the same.