PV22 already brought up bigotry. Synonyms include prejudice. Perhaps also chauvinism, which is now used much more broadly than its original meaning of jingoism, particularly for misogyny. Someone who believes a particular group of people is superior to others and should rule over them is a supremacist.
Someone who thinks people like them should spurn groups of people is a separatist; unlike the other words I list, this is a term that radical groups (such as separatist feminists, red-pillers, or Malcolm X in the early ’60s) sometimes use to describe themselves. When these groups want the separation to be enforced by law, that becomes apartheid, which always have negative connotations. Especially in the United States, segregation has historically meant either private businesses refusing to serve members of a group, or laws to prevent some group from participating equally in society.
For what it’s worth, the neutral sense of “discrimination” is nearly extinct. Years ago, when I was taking economics as an undergrad, the (British) professor got to the topic of “price discrimination” and the (American) students all said, no, discrimination is illegal. He explained that, in economics, it's just a neutral term for charging any two people different prices, but they weren’t buying it. In common use today, “discrimination” is some action motivated by prejudice, and doesn’t convey the original, neutral meaning of making distinctions.