There was also a female character known as Number One, a cold, efficient and logical woman to play against the hot headed, libidinous Kirk. She was intended to by played by Majel Roddenberry, then Majel Barrett. Gene Roddenberry was dating her at the time, but hadn’t yet divorced his estranged wife. The studio producing Star Trek was uncomfortable A) with a woman as such a central character and B) with the scandalous nepotism of the whole thing. They also didn’t particularly like Spock as a character, and so as a compromise Roddenberry eliminated Number One, made a Spock the emotionless one, and promoted him to First Officer.
And thus, Nichols was instead cast as the legendary Lieutenant and the rest, as they say, is history.