Williams was docked a game in the second set of her defeat against Naomi Osaka at Flushing Meadows in September for calling umpire Carlos Ramos a “thief” after previously receiving two code violations for coaching and smashing her racket.
The 36-year-old was insistent she had not received coaching, saying on court she “would rather lose than cheat”, before accusing Ramos of sexism in her post-match press conference.
Federer says the incident should have been avoided by both parties but believes it actually served the sport well because it got the ball rolling on a much-needed debate.
“It’s a melange of all things, but at some point, I feel like Serena should have walked away,” Federer told The Times.
“She did, but she went too far. She should have walked earlier. It’s a little bit excusable. The umpire maybe should not have pushed her there. It’s unfortunate, but an incredible case study.
“Anything that’s good for society and gets the ball rolling, I’m all for it.
“We do so well in tennis; our sport is so well behaved. You see the UFC guy [Conor McGregor] throw a railing, or in other sports they spit and swear at each other on a regular basis.
“I dove into the situation with Serena on so many levels, to understand [from the perspectives of] the umpire, Osaka, Serena, the crowd.”