Symbolism, Imagery, Allegory
Aliens have a long history in science fiction stories. Sometimes they're the villains trying to destroy humanity: think H.G. Wells's The War of the Worlds. Other times they try to help humanity succeed in reaching a goal: we all remember Arthur C. Clarke's 2001: A Space Odyssey. In most cases, though, regardless of their role in the story, aliens represent the "Other." It's as simple as this: the Other is other because they are different from you physically, they have different customs than you, or they have alternative ways to look at the world. Or all of the above.
The Martians in Stanger in a Strange Land fit into the all-of-the-above category. They are the ultimate "Others." Their way of life is the yin to our yang. Whereas we raise children and then compete with each other as adults, the Martians let their nestlings compete for survival and the adults live rather danger-free lives. We separate science, philosophy, and religion on the principles of observation, reasoning, and faith. The Martians have more of an "eh, whatever" approach.
The purpose the Martians play in the novel is to grant us—lowly human readers—a window to view ourselves as an Other for a change. Mike is the perfect contrast for us:
"Smith is an intelligent creature with the ancestry of a man, but he is more Martian than man. Until we came along he had never laid eyes on a man. He thinks like a Martian, feels like a Martian […] He's a man by ancestry, a Martian by environment." (3.15)
Customs and traditions we see as everyday and normal, Mike finds to be completely alien, or Martian, as it were. And because he is actually a "man by ancestry," it makes our Otherness even more striking… and strange.