In the earliest versions of D&D, the playable humanoid races of elf, halfling and dwarf didn’t have a race+class categorization. There wasn’t an option to play a dwarf cleric or a halfling magic user. You played a dwarf (fighter), an elf (fighter/magic user) or halfling (fighter sort of?). In AD&D the humanoid races had limitations on which class they could play. 2E retained that but expanded the classes available. 3E and beyond more or less opened up the gates to any combo you want.
The WotC “do what thou wilt shall be the whole of the law” approach to this seems ridiculous to me based on what we know about culture and pressure one feels to comply with cultural expectations. Let’s look at a few examples. The Mongols were horse archers. They could fight with melee weapons but their preferred and most effective form of warfare was with a bow from the back of a horse. Unlike the knights the Mongols faced when they invaded Europe. The mounted cavalry of Europe didn’t use archery from horseback at all. If you were an aristocratic knight in Poland who decided to shed his mail and lance for a bow, your fellows would thought you had lost your mind. There are lots of examples of this throughout history. A Spartan citizen was a hoplite, period. There was no other option. It makes complete sense to me that a particular humanoid race would have their own cultural biases and preferences so that trying to have a particular profession that clashes with cultural expectations would be extremely unlikely.
While I don’t exactly agree with the way it was implemented in original and basic D&D. Race as class makes far more sense than a halfling paladin of St. Cuthbert riding his war pony into battle against a half orc cleric of Boccob.