Actually, they are not obviously friends in that episode. They don't even appear to know each other that well. "Ah, another one of your Earth emotions..." -- Spock does not even yet have a robust theory of mind regarding humans to interpret the moods and attitudes of humans around him. Kirk is more chummy with his male human counterparts (chatting about Spock's oddness). Spock is a subordinate in that episode. He is an outsider in that episode and it is his alien nature that allows him to see that Gary Mitchell must be killed or stranded.