Because your desire to be a part of something greater has overshadowed your own happiness.
There really is no "true" answer to why racism or prejudice exist in the world. It can be because you had a negative experience with someone of that race, it can be because of your own cultural and familial history that taught you to hate said group of people, it can be because of general fear and assuming the worst of others.
But the most common is the need to be feel special and united against something. Literally anything. Something that your brain can go to back and say your special. "I'm white/hispanic/black/asian/jewish. I'm not like those other races. I'm part of the superior group of people. My race means something and because of that I mean something". It's not that far off thinking from the people who believe the world is flat.
It's easier to reject her because it's easier to fall back into something proven to be log lasting like culture unlike people who always have the chance to reject you. to disappoint you, to cheat on you, to hurt you. Culture is abstract, people are real. You can always rely on your prejudism to make yourself feel better, you don't know if that relationship with the qt mulatto chick will last.
But ultimately the thing that makes race or cultural identity so easy to fall back into can also feel somewhat empty: It's abstractness. It can never replace people, friendship, interactions with others. You can try to resolve this by hanging out with people of the same race and beliefs, but you'll essentially be locked in an echo chamber talking to people out only hang out with because they tell you what you want to hear and vice versa.
But at the end of the day your race or ethnicity or gender or sexual orientation or whatever attribute people use to justify their tribalism is simply one part of what makes you an individual. You're your race. But you're also you. And you're race is ultimately a small footnote of what is you.