I like the attitude of a Navy commander during a race awareness (I think that's what they called them — this was in the late 1970s) when he said: "We know some of your are prejudiced against some people because of their race, or skin color, or religion, or where they come from. The Navy doesn't think they can give you some lectures and change all that. BUT! While you are in this Navy, while you wear this uniform, you will never, ever act on those prejudices, or we will come down on you with the full weight and consequence of the UCMJ*!"
I found out that this wasn't always true, alas, but I liked the sentiment: we can't change the way you think, but by god we can change the way you act or you WILL suffer!
*Uniform Code of Military Justice — the rules for how the US military operates.