Heinlein was born in Butler, Missouri, but spent his childhood in Kansas City, Missouri, in the early years of the 20th century. This was a time of great religious revival across America, especially socially marginalized areas such as Missouri. The outlook and values of this period would inform his later works; however, he would also break with many of its social mores, at least on an intellectual level, frequently portraying them as narrow-minded and parochial.
As in the work of other authors, in Heinlein's work there is little clear distinction between the themes of his work and the sort of philosophical views that he propagated.
In his book To Sail Beyond the Sunset, Heinlein has the main character, Maureen, state that the purpose of metaphysics is to ask questions: Why are we here? Where are we going after we die? (and so on), and that you are not allowed to answer the questions. Asking the questions is the point for metaphysics, but answering them is not, because once you answer them, you cross the line into religion. He doesn't really say why, but the answer as to "why" is obvious: because any answer is an opinion[?]. It may be a good opinion, or a bad one, but it's only what the person who wrote the opinion believes. Such opinions cannot be validated, e.g., you can't ask the person to show you what it is like after death or provide for a personal audience with their God or gods.
Struggle for self-determination
The theme of revolution against corrupt, nasty oppressors informs several of Heinlein's novels:
The theme of self-making
The theme of self-making is taken to its furthest in the related books Time Enough for Love, The Number of the Beast, and To Sail Beyond the Sunset. We are invited to wonder, what would humanity be in the absence of all customs? How would our humanity be expressed if we did not develop under the soul-squashing influence of culture? We would be individuals. We would have self-made souls.
Other recurring themes binding Heinlein's works together include individual dignity and the value of both personal liberty and responsibility, the virtue of independence, science as a liberating factor, the perniciousness of bureaucrats, the brutality of corporate power, the hypocrisy of organized religion, and the subjective value of mysticism.