Benjamin Olson
Hero
I think the contemporary official settings run towards having worlds with substantial cosmopolitan components. Most of these worlds have great cities where it would be normal to find people of most any race filling most any role and which are cultural melting pots where it seems probable you can find a grizzled old elf willing to teach non-elves bladesinging, or a dwarf willing to teach outsiders his special dwarvish method of having stupid spikes on his armor. Unless there is a specific biological limitation I think racial classes or subclasses don't really jive with the cosmopolitan nature of the campaign fantasy worlds, because at least for the core races they are places where every weird races/class/background combo should be possible by means of some eccentric back story.
If your setting is one with far less cultural commerce it may make more sense. For races dominated by isolationist cultures it may even make sense within an official campaign setting like the Forgotten Realms. But really it is only makes lore sense with extreme examples and I don't know what the benefit of a general restrictiveness is. Going beyond race restricted subclasses or classes to outright "you are this race and so this is your class" really only makes sense if you are trying to replicate the Spartans or some similarly extremely unusual and restrictive culture, and even then it seems like a blunt instrument to achieve the lore goal.
If your setting is one with far less cultural commerce it may make more sense. For races dominated by isolationist cultures it may even make sense within an official campaign setting like the Forgotten Realms. But really it is only makes lore sense with extreme examples and I don't know what the benefit of a general restrictiveness is. Going beyond race restricted subclasses or classes to outright "you are this race and so this is your class" really only makes sense if you are trying to replicate the Spartans or some similarly extremely unusual and restrictive culture, and even then it seems like a blunt instrument to achieve the lore goal.