William Windom was cast on Star Trek: The Original Series partially because of a unique trait
Originally, Norman Spinrad, the writer of the Star Trek: The Original Series episode "The Doomsday Machine," wanted Robert Ryan to play the part of Commodore Decker as he envisioned a tougher character. But William Windom was cast for the role instead as the producers wanted a softer version of a commanding officer, essentially one who would be a broken man of sorts.
The reason why Windom was given the role was, according to Windom, who is quoted in Star Trek The Illustrated Oral History: The Original Cast, was basically a no-brainer. As evidenced by the episode, Commodore Decker broke down after losing his crew and then sets his sights on eliminating the machine using the Enterprise. But he's clearly not in his right mind, which was something Windom had no issues playing.
"Commodore Decker is an emotional wreck. I used to be known in those days as "Willie the Weeper." Whenever they needed someone to break down on a show confessing to murder or infidelity, anything where something happened to this guy and we watched him disintegrate on camera, they would say "Get Windom—bring in Willie the Weeper. "
- William Windom
Windom does play the part of a broken man perfectly even though he wasn't particularly enamored with the episode itself. He thought the entire premise was silly and cartoonish, and he said he played the part accordingly.
Though Windom didn't care for the episode, which was nominated for a Hugo Award in 1967, it has gone on to become one of the most popular episodes of The Original Series. On the series' 25th anniversary, a fan survey ranked this episode as number four in the top ten episodes of the series. In fact, it's rare for this episode to fall out of the top ten when listing fan favorite episodes of The Original Series.
And in 2016, Syfy ranked Windom's performance as the fourth best guest star on the series, coming in behind Mark Lenard, Joan Collins, and Ricardo Montalban. So even though Windom wasn't particularly impressed with the episode, fans and critics alike were impressed with his portrayal of Commodore Decker