Maybe first is the wrong world but they are the ideological ancestors of the Third Reich.
In Sparta your genes determined if you where either a proper person who whose only purpose was to out breed (and for a man fight) or a helot subhuman who did all the work.
Racist really isn't the right word. Sparta wouldn't have a concept of "race." It was an extreme oligarchy based on the persecution and terrorization of the Helots, 90% of the population for the benefit of the elite 10%, a system everyone was born into. But there was the possibility of being "freed" or of a Spartan to lose their citizenship, making it not equivalent to racism. It was inherently vile, deadly, and is unfairly revered in the modern day in a way that is quite disturbing, but racist is simply not the right word.