This sounds like the justification for the society featured in Huxley's Brave New World. It may not totalitarian by the dictionary definition, but it's definitely authoritarian.
Then the definition of both totalitarian and authoritarian needs to be expanded and made inclusive. There’s no central figure/politburo telling a believer in caste that they have to believe in it for the greater good. It’s Vaclav Havel’s description of communism - everyone’s playing along with the caste charade because their neighbor’s are.
It has suffused society to the extent that Indian Muslims will sometimes complain that a Muslim tanner (considered low caste because they work with carcasses) wanted to marry into an upper caste Muslim family. Islam rejects caste per se so this caste based thinking is endemic to Indian society, not religion.
Edit - I am not justifying caste. I’m just pointing out that the previous commenters above me were needlessly limiting the types of societies to anarchy and totalitarian. They should include fatalist societies too.