Maybe, if he saw the problem, he could've prefaced the example with warning, or otherwise acknowledged the sensitivity. I didn't get a sense that the offense was intentional.
The article had a comment that suggested someone didn't see how the similar sounds were a problem.
One reason I would suspect it's a problem (which I heard in a TV show, in which a character explains how an anti-gay slur is hurtful to them), is that they grew up hearing that slur hurled in the context of other injustices, from childhood.
I can also imagine that insensitivity to how hurtful a slur is could feel like a signal that someone doesn't understand or care about the associated injustices.
This hurtful mistake could be a learning moment for the professor, and maybe he could then help a lot of other people to also learn something constructive from it, and help everyone move forward in understanding and helping each other.