Spock is probably a commissioned officer with some teaching duties, hence the grey uniform (instructor) while in the Academy.
Not perfect, but I like it,
Remove the word "probably" from your statement. He designed and teaches the Kobyashi Maru plus he was Pike's first officer. He is much older than Kirk and as such had been a Starfleet officer for quite some time.