I love the idea if a caste system and have been toying with adding it
Are you restricting caste to just belonging to a religious / idea logical subset or are you also extending it to role?
It's not a far fetch to have people restricted to religion based on what their group/family do but actually having people have to define their job and livelihood by the sect they are born in is great
I thought about having everyone born with a tatoo marking and if your child is not the same marking as you, you raise them until they reach pubity ad then they are indoctrinated into their new caste
This creates a sub culture of people who are essentially traded at a young age out of their family so the family dynamic is much different than it is in our world since if your child doesn't fit with your caste then you become a foster parent for then
With the addition of one extra caste, Kaidan's social caste system is identical to feudal Japan's caste system: Aristocracy, Samurai, Commoners, Animal (yokai), and the Tainted. Animal (yokai) is the added one to accomodate non-humans of Kaidan (includes: hengeyokai, kitsune, korobokuru, kappa and tengu). Kaidan is very humano-centric with non-humans are treated poorly, so most non-humans dwell in wilderness areas.
What I've done is taken the Buddhist Wheel of Life (five hells) and applied those planes of existence into the social caste system. As one adventures for each lawful or good and chaotic or evil act, the GM assigns a positive or negative karma point. Thus karma (positive and negative) accumulate for each PC (you generally can only acquire 1 karma point per encounter). Each plane of the Wheel of Life consists of a range of karma points from 1 to 180 points. Depending on what your karma score is at death (plus a d20 roll) determines which caste you will be reborn into in the next life. Kaidan uses this unique reincarnation system that determines which social caste you belong based on actions you committed in your previous life. In Kaidan there is no raise dead/reincarnation (by spell)/resurrection, when you die, you're dead and cannot be brought back, as you are now in Kaidan's Wheel of Life/reincarnation mechanic - you will reincarnate and no way to stop or alter it. Your current karma score compares to the ranges of karma scores to each social caste, and whatever your's is, determines in which caste you will be reborn.
The other monkey wrench to throw in here, and another part of the horror aspect of the Kaidan setting, is if you die in a violent manner, such as during combat, at death your spirit begins a journey into Yomi, the land of the dead (pocket ethereal plane) where you wait up to 7 days... then your spirit identifies somebody (base on a roll on a chart) that fulfills your karma expectation and social caste, and attempts to possess that person. If your spiritual possession attempt succeeds, you drive the existing person's spirit from their body, essentially killing them, and you wake up having reincarnated to a person with levels in a new character class (more than likely, though you can reincarnate into your previous caste, based on whatever your karma score is at death.) Now the recently killed spirit (previous tenant of the body you now inhabit) begins their own journey through the Wheel of Life mechanism. Thus there are always spirits roaming around looking for people to possess in an endless cycle.
So, yes, I use a social caste system, but a very convoluted one determined by esoteric concepts of Buddhism.