Federer, 39, decided to end his Roland Garros campaign on Sunday, a day after winning a gruelling third-round match against Dominik Koepfer, Reuters reported.
Eight-time Wimbledon winner Federer, who has hardly played in the last 17 months because of a knee injury, had been due to face Italian ninth seed Matteo Berrettini in the French Open on Monday.
Replying to a tweet from a user who said Federer was "disrespectful" to other players for "using" the French Open to gain fitness, Murray said: "In basketball, football etc when returning from injury players are given reduced minutes to build up their fitness.
"In tennis you don't have that luxury of just playing a set in first match then 2 sets the next etc and building up that way.
"I'd argue that it's quite risky to play multiple 4hr matches in a row in your 2nd tournaments back in 18 months so to me it makes sense to be reactive based on how your body feels, length of matches etc (sic)."
Federer's decision sparked mixed reactions, with seven-time French Open winner Chris Evert saying the Swiss had earned the right to do so, while former U.S. Davis Cup captain Patrick McEnroe said he understood Federer's reasoning, but it was not a good look.