Other than a quick trip to a committee room on Earth, the setting for The Moon is a Harsh Mistress is the Moon. In this future, our solar neighbor has been colonized and established as a penal colonial—very similar to what the British did with Australia in the 18th and 19th centuries.
A Lunar Tour
Due to the lack of water, food, and air, Luna proved a harsh environment for the criminals sent there. Mannie notes that death was a way of life in the early days of the lunar colony (2.5), with three out of every four people dying. Yikes. The lack of natural resources also meant that everything—even air—was up for sale.
As the Loonies began to form families, the society became a true melting pot. The more "mixed breed" a person is, the "more a Loonie" (3.23) they seem. Manuel's full name is a perfect example of this as it shows roots of Spanish, English, Irish, and Hebrew heritage (for more on this, be sure to swing by his page in the "Characters" section).
Different cultures and languages also mixed together on Luna. This is evident by Mannie's pidgin English and all the terms adopted from French, Russian, English, and Australian in Luna slang. Check out the "Tone" section for more on this.
But, the longer the colonists stay on the moon, the more difficult returning to Earth becomes, and although it's not impossible, there are several factors that keep Loonies lunar. The lower gravity means their muscles can't handle the strain of Earth's higher gravity well, and the Moon's more sterile environment—everything is sterilized for consumption, from water to air—means airborne diseases are far fewer on Luna. A Loonie can visit Earth, but it requires him or her to prepare for the trip by wearing weights and going straight to the hospital when they set down.
As Mannie notes: "My Grandfather Stone claimed that Luna was only open prison in history. No bars, no guards, no rules—and no need for them" (2.3). Seems he was right.
A Harsh Mistress Indeed
This setting plays an important role in the story because it is responsible for Loonies having developed the culture they did. As Prof notes to the Federated Nations committee:
"But Luna herself is a stern schoolmistress; those who have lived through her harsh lessons have no cause to feel ashamed. In Luna City a man may leave purse unguarded or home unlocked and feel no fear… I wonder if this is true in Denver?" (17.31)
Luna's environment requires the Loonies to learn different lessons from those on Earth, and these lessons mean that the Loonies have developed a culture and society very different from anything on Earth. There are several examples of this.
For instance, Loonies live longer than people on Earth, but the chance their life will be cut short is greater. As such, the Loonies have no patience with bureaucracy. They don't have licenses, fill out forms, manage permits, or do anything else one associates with a government office (6.51). The DMV could not be a thing in Luna society for several reasons—the least of which is because they don't have cars.
The Loonies also view enterprise differently. Everything is available on an open and free market—and we do mean everything. Air and water are big ones, but trials and other legal services are also all bought and sold by private individuals and not a state entity (11.46).
Since the female population is far less than the men, women are treated differently in Luna society. As Mannie explains it: "What that means, here and now, is that women are scarce and call tune… and you are surrounded by two million men who see to it you dance to that tune. You have no choice, she has all choice. She can hit you so hard it draws blood; you dasn't lay a finger on her" (11.119). In other words, the ladies say jump, and the men ask how high.
Finally, marriage has also developed uniquely on the moon. Luna society allows "polyandries, clans, groups, lines, and less common patterns considered vulgar by conservative people" (18.124). Prof directly relates the formation of these untraditional marriage patterns to the fact that Luna is such a harsh environment. He says:
"Somehow human beings always cope with their environments. Lines marriage is a remarkably successful to that end. All other Lunar forms of marriage serve that same purpose, though not as well." (18.134)
The reason these unique customs are important is because they spur on the revolution. The Authority, and later the Federated Nations, attempts to enforce rules that counter these customs, and when they do, the Loonies rise up to protect them. The Earth-bound government just doesn't understand life for the Loonies.