Jim Kirk broke the rules and risked losing the enterprise and his position as captain to save Spock's life from an erupting volcano and after months of being emotionally fine, Spock becomes emotionally compromised when Jim dies and he almost kills khan.
“It’s this role that brought us together and the world of ‘Star Trek’ that we shared in common from the beginning, but our friendship evolved very quickly past all that. I would say, by the end of his life, it was only one of many facets of how we connected and how we came to respect and love each other. He was just an incredible guy; I miss him a lot. But I feel like my approach to this film, which was the first one we’ve made without Leonard, was to really just honor him and carry on his legacy as best I can. I thought that Simon and Doug did a wonderful job of involving Leonard in this film and honoring him and making it a part of Spock’s journey. That was important to me and really satisfying. I think that it turned out quite beautifully.” – Zachary Quinto on honoring Leonard Nimoy in ‘Star Trek Beyond’