I think the joke is in poor taste, but certainly within the judge's free-speech rights. Who hasn't told an off-color or racially insensitive joke at some time or another.

Hell, I tell them regularly!