It was in the very first incarnation of D&D. Witness ye, the words of OD&D (Men & Magic) from 1974:
Magic-Users: Top level magic-users are perhaps the most powerful characters in
the game, but it is a long, hard road to the top, and to begin with they are weak,
so survival is often the question, unless fighters protect the low-level magical types
until they have worked up. The whole plethora of enchanted items lies at the
magic-users beck and call, save the arms and armor of the fighters (see, however,
Elves); Magic-Users may arm themselves with daggers only.
And therein lies your answer. A core part of D&D balance from the beginning has been that wizards wield incredible power but are fragile physically and can't use armor or most weapons. Gygax made that a part of the game, as it was how he envisioned his fantasy world grafted to a wargame to work.
The in-fiction justification back in the day for this restriction was simply that 'that class doesn't get around to learning that." Proficiencies as a formal idea that you could take instead of just having a monolithic bundle of abilities based on your class didn't come till later. If you dual or multi-classed, you could cast wizard spells in armor just fine by the way, there was originally no real inhibitor except that "wizards don't learn that in wizard school."
However, even "proficiency" is a compelling argument - armor's not "just clothing." Untrained people put on wetsuits, climbing harnesses, etc. in laughable, inefficient, binding, and frankly dangerous ways. Football players spend a lot of time micromanaging their pads and helmets and learning to move in them. The idea that "I'll just slap this armor on it'll be fine" falls down when its specific adjustment is what keeps you from getting bones broken from deflected blows, or from it getting caught on the battlefield/foes/weapons and dragging you to your doom.
One can also argue the influence of genre tropes (Gandalf didn't wear armor!) on this long-standing trope, but that's pretty much an opinion-fest, and is already on this SE as a closed question: Where does the stereotype that wizards can't wear armor come from?
Armor Across The Editions. According To The PHBs
0e, 1e, and 2e: Magic-users couldn't use armor because they weren't trained in its use, period. They are busy learning spells from books instead, and armor is a bit binding and impedes somatic components. Races that could multiclass or dual classing in general let you cast magic-user spells in armor.
3e, 3.5e, and Pathfinder: Magic-users can gain proficiency in armor but even then there's a spell failure chance for spells with somatic components because of armor's restrictive nature.
4e, 5e: Armor has no specific effect on spellcasting, though if you're not proficient you take various penalties to everything including spellcasting.
As you can see, the approach has really been quite consistent. Even before there were proficiencies, and after, the general explanation is "if you aren't proficient in armor, then you will have trouble with your spells," though that penalty has lessened over the years. It's a mix of game balance and realism - the same reason a wizard doesn't know armor and weapons is the reason a warrior doesn't know spells - in life, you have to make choices about what you learn, and "all of it" is not a feasible answer, at least not as a 16-year-old starting adventurer! In earlier editions it was harder to learn things in general as it was very class-based; now that there are proficiencies and stuff a wizard can learn armor like anyone else, by making that tradeoff to not learn something else useful.