Fallout: New Vegas lead writer 'loved writing' Yes Man, but thinks his questline may have been a mistake: 'It lets you get through the game without getting your hands dirty'
The sycophantic, (mostly) immortal robot made certain design constraints easier to work around, but it allows for a "rebellious, individualistic" player to bypass some tough choices.

(Image credit: Obsidian)
There are no squeaky-clean factions in Fallout: New Vegas. Caesar's Legion is outright authoritarian and psychopathic, Mr. House's ruthlessness and egomania make him hard to trust, and while the New California Republic is comparatively easier to live with, it's far from heroic.
As lead writer John Gonzalez told PC Gamer in an interview with associate editor Ted Litchfield, that's all by design: "I remember when we were just kicking off the project, [New Vegas lead Josh Sawyer] coming into a conference room and saying, 'Okay, so we're not doing any good or evil, black and white stuff. We're doing everything in shades of gray. It's going to be moral ambiguity and complexity.'"
Telling Yes Man you're the Courier after he tells you he set you up - YouTube 
But another mandate from Sawyer required that the player also have utmost agency: "The player has to be able to get through this game killing everyone they meet the moment they meet them, and also killing absolutely nothing at all," Gonzalez recalled. That's where Yes Man came in.
If you haven't played New Vegas, Yes Man is a robot sporting a goofy grin and an inability to decline any command or truly be disposed of. If the player kills him, he simply transfers to another metal body elsewhere. Yes Man was designed as the perfect consigliere to assist in a takeover of New Vegas, outmaneuvering all the other factions, and the player can take over his original owner's plan without missing a beat.
Gonzalez explained he was created to give the player an out if they managed to make enemies of the entire wasteland: "What if the player just torches every single [faction]? What if you kill House, you blow up the NCR on the strip, you assassinate Caesar? What the eff is going to happen? I was cogitating on that, and I had this thought: Well, what if you just had a main quest giver who you effectively couldn't kill?"
Fortuitously, the idea made for a pretty entertaining character, as well. "It is this sycophant who engages in the ultimate unhealthy relationship with you," Gonzalez said. "You blow it apart, and it comes back and says, 'I'm so sorry. It was me, not you.' Of course, [voice actor] Dave Foley milked that for all it was worth, he was a great choice."