In a post to correct an assertion by SF author David Brin, Eric S. Raymond shows just how influential the writings of Robert Heinlein were to the early libertarian movement:
Robert Heinlein was a complex man whose views evolved greatly over time. The Heinlein of 1942, who put into the mouth of one of his characters the line “Naturally food is free! What kind of people do you take us for?” was only five years on from having been enchanted by social credit theory, which underpins his “lost” novel For Us, The Living; in later years he was so embarrassed by this enthusiasm that he allowed that manuscript to molder in a drawer somewhere, and it was only published after his death.
Between 1942 and 1966 Heinlein’s politics evolved from New Deal left-liberalism towards what after 1971 would come to be called libertarianism. But that way of putting it is actually misleading, because Heinlein did not merely approach libertarianism, he played a significant part in defining it. His 1966 novel The Moon Is A Harsh Mistress was formative of the movement, with the “rational anarchist” Bernardo de la Paz becoming a role model for later libertarians. By 1978, we have direct evidence (from an interview in Samuel Edward Konkin’s New Libertarian magazine, among other sources) that Heinlein self-identified as a libertarian and regretted his earlier statism.
But if Heinlein’s overall politics changed considerably and wandered down some odd byways during his lifetime, his uncompromising support of civilian firearms rights was a constant on display throughout his life. Brin observes that was already true in 1942, but attempts to attribute this position to John W. Campbell. Multiple lines of evidence refute this claim.
[. . .]
(When time has given us perspective to write really good cultural histories of the 20th century, Heinlein is going to look implausibly gigantic. His achievements didn’t stop with co-inventing science fiction and all its consequences, framing post-1960s libertarianism, energizing the firearms-rights movement, or even merely inspiring me to become the kind of person who not only could write The Cathedral and the Bazaar but had to. No. Heinlein also invented much of the zeitgeist of the 1960s counterculture through his novel Stranger In A Strange Land; it has been aptly noted that he was the only human being ever to become a culture hero both to the hippies of Woodstock and the U.S. Marine Corps. I am told that to this day most Marine noncoms carry a well-thumbed copy of Starship Troopers in their rucksacks.)