The official novelization of the film by J.M. Dillard explains several absences, not only Spock's but also those of McCoy, Uhura, and Sulu:
He was not quite sure what prompted Kirk's sudden outburst of mulishness, except possibly the recent disappointing news that Spock and McCoy would not be joining them for the christening ceremony. Nor would Uhura, who was vacationing in a far-off region of the galaxy before returning to teach at the Academy, or Sulu, who was off commanding the Excelsior...
...Spock was involved with a diplomatic mission on behalf of Vulcan and could not free himself...As for McCoy, he and his family were attending his granddaughter's graduation from the Vulcan Science Academy...
I interpreted the question as in-universe, but if you are also interested in out-of-universe reasons, here are some reasons why only Shatner, Doohan, and Koenig appear in the film:
Leonard Nimoy was asked to appear (and even asked to direct), but he felt that the script had issues and that the lines given to Spock were quite bland and could have been given to any character. He subsequently declined to be involved. Those lines were eventually given to Scotty, which Nimoy felt was proof that he was correct!
DeForest Kelley's declining health meant he couldn't get on-set medical insurance; his McCoy lines were given to Chekov.
George Takei was approached about reprising his role as Sulu for the Enterprise-B's helm officer, but he disliked the idea of Captain Sulu serving as a helm officer after having commanded the Excelsior. The character of his daughter, Demora Sulu, was created in response.
(Source)
Finally, a bit of trivia, in the spirit of your question: this is the one and only time that Kirk has appeared in a Star Trek episode or film without Spock!