"It is not the first time that favouritism has occurred," he said after the match.
"I do not think I lost by that ball, but in my opinion I do not think the referee was right there.
"I'm a bit disgusted with the result because I think I have made merits to win or to put myself in a position to win, it was the first time I had Federer on the ropes, it was a good day to beat him and in the end he was not able to win.
"It was a very tense moment, I went 30-0, with two good serves, I was 30 equal and I felt the tension of having Federer in front of me.
"That the match was at a very critical point, a decisive moment like that, in a deuce, a point more or a point less is decisive."
Federer's win came after paying tribute to long-time rival Rafael Nadal as the Spaniard takes time off from the court to help his country out amid a flash flooding crisis.
"I know how important Majorca is to Rafa and I have been in touch with him to see if I can help with anything," Federer said in a video message.
"I have seen him helping in the village where he comes from and to see that is super-inspiring. Rafa, you have our support.
"We are thinking of all the people in Majorca. We wish you strength in these difficult times and I hope to be back on Majorcasoon."
Fellow rival Novak Djokovic, also taking part in Shanghai, said he hoped Nadal's efforts would inspire others.
"A big hug and friendly regards to Rafa and well done amigo for helping out," said the reigning Wimbledon and US Open champion.
"I invite anyone to give their support in anyway they can. Gracias."
Federer and Djokovic are currently locked in a battle for the World No. 2 spot with the Serbian star just two wins away from pipping the 37-year-old.
He needs to make the final of the Shanghai Masters to go up a ranking.