The whole thing was a parallel to the glasnost
taking place between the ex-Soviet Union and the United States. I'm sure most of my fellow Americans are quite aware of Soviets being called heathens and Commies, with attitudes not unlike those of Kirk and company.
It flies in the face of TNG's perfect humans a bit, but I don't have much of a problem with it. I think there's plenty of foundation for Kirk and crew to feel the way they do, and I certainly don't consider it racism. Prejudice, sure.