All Apollo lunar missions had a third crew member who remained on board the command module.
Source: https://en.wikipedia.org/wiki/Moon_landing#Crewed_landings
Imagine being the guy who has to risk his life just as much as the two others, for the scary launch and all the way through space to this huge, mythical rock, looked at by countless billions of human beings since the dawn of man, which they successfully land on, and then have to watch your two crew member buddies get to exit the door and walk out on the Moon's surface, running and jumping around like kids, while you are forced to watch them through a little window while noting down boring numbers on a paper and going through some checklist for the take-off.
Imagine the psychological impact that must have on a person; to have literally gone to the moon as one of a handful of human beings ever in the history of mankind, but then have to admit to everyone while telling the story of your space pioneering adventure:
Weeeell, I didn't exactly get to go out, but I was there! Yeah! It was awesome! Really! I noted a lot of important metrics! It was an important job! Somebody had to do it! I'm not bitter! I didn't want to go out there anyway! For real! I swear!
Would it really be so risky for them to allow the last astronaut to also at least get to take a little short walk on the surface of the Moon? Even just symbolically climbing down the ladder and pressing your foot against the dusty but solid surface, stand there for a moment, bounce around for a moment, and then go back up again? Why would they deprive the third crew members of each mission this truly once-in-a-lifetime opportunity?
I don't understand the mentality behind such a decision. Other than just being mean and cruel, it also seems very dangerous for the entire mission. What if, once they land, the unlucky third crew member snaps and goes:
Screw you guys! I'm going out there! Try to stop me if you can!!
And the others go:
No! Wait! We haven't depressurized the lunar module yet! You're going to kill us a...
And then there's silence, except for the radio saying things like:
Ground control to lunar module! Can you hear us? We repeat: can you hear us? Over!
Maybe a drastic and unrealistic example, but I can very well imagine that the person who (presumably) was pre-selected (or pre-doomed, rather) to stay inside would "lose it" once they are actually there, and go to extreme lengths to get his moon walk, or even to subconsciously do some kind of mistake which affects the two others. But perhaps that's just how I know that I would feel. Maybe others truly only care about doing the mission and have zero desire to go out and play on the Moon?
Still, you'd think it would be a minimal "reward" to at least symbolically have "set foot" on the Moon, then quickly go back inside while the other two do all of the stuff they are there to do. What could possibly happen once the two others have already exited safely? Did they expect a little green monster, hiding behind a rock, to quickly run into their module, shut the lid and then take off to their home planet?