90% of the reason is that Gygax preferred a human-centric world, and if that borked the elves and such, so be it. He preferred classic swords-and-sorcery, and insofar as he was willing to let LOTR taint D&D, he preferred the idea of humans carving out a world in which elves and dwarves were diminishing and dragons were to be slain.
From a world design standpoint, there's the whole centuries thing. However, it's a pretty weak rationale. Frankly, high level characters are not going to die in bed unless they retire, and XP in the old days was based on treasure and defeating monsters. Plus, it had no effect on special-case NPCs, and you can safely assume the very most powerful elves and so forth might be special-case characters. Folks like King Arthur, Drizzt, and Elminster are shameless rulebreakers, so there is no reason not to apply that same reasoning to Galadriel. I would assign this reason, then, to the realm of "rationalizing."
From a balance standpoint... humans gained nothing, nothing, unless you had two ability scores and a master plan for dual-classing. Even halflings had superior abilities, provided you weren't interested in extraordinary strength and melee combat. However, demi-humans were deemed to be constrained by their natures, and hence were forbidden from classes that did not fit their culture or psychology. Setting level limits therefore often served as a quasi-prohibition. In AD&D 1e, dwarves could be clerics, but only up to level 8. However, only NPC dwarves could be clerics; presumably, their clerics were tied up in duties that prohibited from adventuring. Level limits were then applied across all races and classes, for consistency's sake. Demihuman multiclassers could expect to see one of their classes max out during the course of a normal career.
It is important to realize that in the old days, it was expected campaigns would end somewhat sooner. AD&D typically assumed the campaign was over by 20th level, and up to 30th level was considered very high level gaming. In many cases, it appears campaigns ended in the teens. Name level occured at level 9 or 10, at which point characters started building keeps and settling down, while most of the material was written with the notion that 20th was an informal ceiling on advancement. Deities & Demigods indicated that high level, or maximum level, varied by campaign and ascension to deity status should take this into account. In other words, unlimited advancement was sort of a little bonus thrown in, something for humans to do for a few levels as a campaign wound down. It did not have to be exceedingly balanced because it was an end-game condition. Much like the availability of the highest level spells, it was the conclusion to which the campaign journeyed, after which point the basic challenges had been conquered.
Naturally, this approach clashed with BECMI's adoption of the 36-level model. As a result, it is no surprise that BECMI added "virtual levels" after maxing out demihumn levels. There is no absolutely no reason why they shouldn't have just allowed demihumans to go to 20th level or whatever in BECMI, but inertia won out. Clearly, a few hit points was not going to break the campaign. So in BECMI, demihumans gained better attack capability, more masters, better saves, and special defenses, while not advancing in hit points or (in the case of elves) high level casting. It was quite arbitrary, since demihumans effectively gained level advancement in all but name, admittedly as a slower rate.
It is important to realize also that Gygax allowed demihumans as a play option. His vision was always of a human world. Thus, demihumans are limited, in much the same way some of the weirder choices in Savage Species carried high LAs in 3e, simply because limitations had to be imposed if you wanted the game to continue to look a certain way. In many ways, playing an elf amounted to "play a monster with class advancement, have fun." Elves still fared better than orcs, who were all 1 HD monsters with the occasional 2 HD or 3 HD leader and a handful of individuals with pathetic casting abilities. There is a character in the Pool of Radiance computer game who is a clear rulebreaker, some kind of orc or hobgoblin character who clearly has the capabilities of a 5th or 6th level fighter.
AD&D and AD&D 2e was peppered with "it's your own funeral" warnings. You can allow players to be dragons, pop the lid off racial level limits, or allow a player to make his case why he should be allowed to play the only halfling wizard in all Greyhawk. But it's up to you to clean up the mess. You can let players be gnolls, but if you let them be trolls, there is little in place to balance such characters.