Uhura is there to deliver maybe a handful of lines and show that Spock has a case of the "not gays"
It's little more than that. She furthers Spock's "closeted emotional" gay analogy story by being his secret lover. The inappropriate teacher/student relationship is surrogate to an "inappropiate" male/male one.
She furthers the analogy while showing that Spock isn't actually gay.