I made that comparison because I get sick to death of a couple of Nadal trolls slagging Roger just to counter all the nasty things that some Fed fans/all Fed trolls have said, or they believe they have, about Nadal over the years. (And more than one has cited that specific reason.) That aside, yes, it's an imperfect comparison because Nadal didn't play the USO.
As to specifically Roger dropping out as a precaution and to protect his Wimbledon: you can't say, first of all, that he had no intention of playing it through. I'm sure that part of him hoped that he'd have a good run, and, as a great champion, he would hope the draws and exits might fall his way. His chances may have been lower than in years past, but he was probably 5th or not much lower of the favored to win it. But by all accounts, that match v. Koepfer was kind of brutal, and you can't know what his body is telling him. He had 2 knee surgeries last year. He's 39. And you also can't tell me that the tournament/sponsors weren't happy to have him. That match last night is behind a pay wall, and that's totally trading on Federer. Peacock TV is hoping to pick up subscribers exclusively based on that. So, to some extent, the game takes him on his terms, and after 20+ years and 20 Major wins, I don't see that that's terrible.
On the other hand, if you want to criticize, Roger has done this before. I don't remember the year, but he declined to play the final of the YEC against Novak, after a brutal SF v. Wawrinka the day before. They had a Davis Cup final the following weekend, something Switzerland had never won, and the strong thinking was he was protecting that DC, in lieu of playing the YEC final. Decide if you think that's right or wrong. That one, personally, I had a bigger problem with. Roger's decision to play minimal clay...Geneva and RG...always left his intentions pretty clear. I just don't have a big problem with that.