Short answer: they didn't originally have to be Lawful Good
The original Paladin as published in Greyhawk was aligned as Lawful. Full Stop.
(This is a very minor frame challenge).
The alignment matrix in Men and Magic (TSR, 1974, Gygax Arneson, p. 9) showed three:
Lawful, Neutral, Chaotic. That's it.
The two-axis system was first shown in a Strategic Review article (SR #6, Feb 1976) then in the Holmes "Basic D&D" before AD&D hit the streets but after the original Paladin was published.
Greyhawk (TSR, 1974, Gygax/Kuntz, p. 8) says this about Paladins:
Charisma scores of 17 or greater by fighters indicate the possibility
of paladin status IF THEY ARE LAWFUL from the commencement of play for
that character. If such fighters elect to they can then become
paladins, always doing lawful deeds, for any chaotic act will
immediately revoke the status of paladin, and it can never be
regained. The paladin has a number of very powerful aids in his
continual seeking for good: He can "lay on his hands" to cure wounds
or diseases in others (two points of damage for every level the
paladin has attained, one disease per five levels, either function
performable but one per day). Paladins are not themselves subject to
disease. They have a 10% higher saving throw against all forms of
attack (excluding melee). Paladins of 8th level and above dispel evil
(spells, undead, evil enchanted monsters, and the like) simply by
ordering it hence, and they detect all evil at a range of 6". Paladins
with any form of "Holy Sword" are virtually immune to all magic (see
MONSTERS & TREASURE, MAGIC & TREASURE, Swords)
I bolded the "lawful deeds" and "any chaotic act" but the rest is original emphasis by the author.
In Play: we were a typical adventurer party in a large group in the late 1970's, and had a paladin who was lawful, and who in play was pretty much an example of the lawful good you'd see in AD&D 1e requirements by his own choice to play the knight in shining armor. We ran into paladin NPCs led by a Lawful cleric (but in our eyes, not quite particularly pleasant and for sure not good from our PoV) who came to our town and laid the law down on us, the adventurers. My druid in particular was cited as being an undesirable, since I was a heretical Neutral nature cleric. Our Paladin was criticized for associating with us. (We have a few thieves and a few multiclass X-thiff characters).
Lawful was the overriding consideration: that alignment restriction (which carried over into the Lawful Good later) was a cost for the benefits of the class. You could not just choose to be a Paladin: you had to qualify for it, and you had restrictions (also mentioned in Greyhawk) (1) on treasure and (2) the number of followers you could attract and of course (3) you can't change alignment.
Lawful Good happened originally in Advanced Dungeons and Dragons, 1e
Note that it says, in the original version of the class, that the paladin "is seeking for good." That germ of an idea that Lawful and Good would be married up came to fruition in the AD&D 1e PHB. The stat requirements also increased: Strength 12, Wisdom 13, Constitution 9, Intelligence 9: these were minimums along with a 17 Charisma (rolled up) or you could not qualify for this Lawful Good Paladin sub class of Fighting Man/Fighter.
While the citation of Three Hearts and Three Lions from the accepted answer shows some valid sourcing (no real disagreement) there were additional inspirations that can be seen in the selected entries for the AD&D 1e Gods, Demigods, and Heroes section covering the Arthurian Legends. Galahad and Lancelot figure prominently. If you look at the original Paladin from Greyhawk: the Paladin's laying on of hands can be traced in mythology and literature to be a reflection of Mallory's Morte d'Artur scene where Lancelot revives a knight he has slain. This makes a vivid impression on Queen Guinevere.
Other literary inspiration for the knights in shining armor trope can be found in OD&D and AD&D 1e inspirational reading lists offered by the author. There is a nice summary here in an interview with Mike Mearls where he discusses the roots of D&D in terms of short stories, novels, Moorcock's conception of Law vs Chaos, and more. One of the more interesting tidbits one gleans from the interview with Dave Arneson is that his favorite class to play, in terms of challenge, was the Paladin, but how much input he had in that class, and its final form, may be lost to the ages.