It's not so much that he's 'choosing' them over you. It's more the fact that when you're good friends with someone, you don't just mindlessly laugh along with everything they say, you should be able to stand up to them. If my friend said something racist I would certainly say something. It's irrelevant whether it was said specifically about my boyfriend (although that makes it worse), it's just about having some principles and not tolerating certain types of behaviour. Your boyfriend sounds weak at best, mindless at worst. Definitely stand up for yourself in front of his friends - true, he should tell them where to go, but if he doesn't have the balls then you need to make sure they know that you won't be spoken to like that. Have a serious talk with your boyfriend and ask him how he feels about his friends' views. It would properly put me off a guy if he behaved like that.