When the writers began to flesh out Stewie beyond being a generic evil genius in season two, MacFarlane and the writers began to explore the infant's sexuality with a series of one-off gags, which hinted that Stewie could be gay. On the commentary of Stewie Griffin: The Untold Story, the writers describe how they were going to make Stewie discover he was gay, but decided to scrap this idea in order to retain Stewie's sexual ambiguity for writing purposes.
MacFarlane planned for the series' third season to end with Stewie coming out of the closet after a near-death experience. However, the show's abrupt cancellation caused MacFarlane to abort these plans, and the episode "Queer Is Stewie?" was actually produced, but never shown. Since that point, MacFarlane has opted to have Stewie portrayed as sexually ambiguous, as, in his eyes, the flexibility of Stewie's sexuality allows for much more freedom in terms of writing for the character
MacFarlane later elaborated:
He originally began as this diabolical villain, but then we delved into the idea of his confused sexuality. We all feel that Stewie is almost certainly gay, and he’s in the process of figuring it out for himself. We haven’t ever really locked into it because we get a lot of good jokes from both sides, but we treat him oftentimes as if we were writing a gay character.