Kirk was meant to be the main character of TOS. But Spock was the breakout star, proving hugely popular with viewers (especially female viewers) and getting more fan mail than the rest of the cast combined. So the network kept pushing for more Spock, wanting to elevate him to the main character. If Roddenberry hadn't resisted that pressure, Spock might've ended up following a similar route to Dr. Smith in Lost in Space or Fonzie in Happy Days, completely dominating the show to the expense of its nominal leads. But Roddenberry and Shatner both strove to keep Kirk central as he was intended to be. At Isaac Asimov's suggestion, Roddenberry played up the friendship and partnership between Kirk and Spock, making them inseparable and equal. McCoy was also able to stay central due to his friendly rivalry with Spock.
An interesting example of the Vulcan idiom "The needs of the many outweigh the needs of the few, or the one" in action. Here "the many" are the audience/network, "the few" are Star Trek's producers, and "the one" is Shatner. Star Trek, and Spock in particular, is an interesting case study in how a creation can take on a life of its own despite the initial intent of its creator.