Boston police put two-year officer Justin Barrett on administrative leave pending a termination hearing. Barrett, 36, did not immediately return calls for comment.
Barrett's union, the Boston Police Patrolmen's Association, said they condemn and "strongly denounce these statements as being offensive and hurtful."
But the union added that investigators should consider all the facts and not rush to a conclusion.
Police said Barrett does not have previous violations with the department.
A person with knowledge of the case, speaking on condition of anonymity because the person was not authorized to speak publicly about it, said Barrett, a member of the National Guard, used the racial slur in messages to guardsmen and to The Boston Globe.
Boston Mayor Thomas Menino told WCVB-TV the city needs "to rid the department of that cancer."
"An individual preaching hate has no place in our society," Menino told the local television station.
The mayor told WCVB-TV that Barrett was trained in racial profiling prevention and had shown no signs of racial discrimination in the past.
Gates was arrested for disorderly conduct in his home near Harvard University by a white police officer who was responding to a report of a possible burglary. The charge was later dropped but the case sparked a national debate over racial profiling, one that was intensified when President Barack Obama said Cambridge police "acted stupidly."
Gates did not return phone messages left at his home seeking comment.
Meanwhile, Manhattan Borough President Scott Stringer accepted the resignation of Lee Landor, his deputy press secretary, after she called Gates a racist and referred to President Barack Obama as "O-dumb-a."
Landor's comments on the social networking site Facebook were inappropriate, Stringer said in a statement.
Landor defended her entries, but added: "It is understandable that a black man encountering police will be suspicious of racial profiling, based on the long history of racism in this country."