Spock relinquished command in TWOK due to the ship going out on an actual mission.
Which really shouldn't have been necessary. There's no reason Captain Spock couldn't have stayed in command of the ship while Admiral Kirk commanded the mission -- kind of like Voyage to the Bottom of the Sea where Captain Crane was in charge of the ship while Admiral Nelson directed its missions.
...Star Trek V had Spock on shore leave with Kirk. If you wanted to, you could assume that Spock may have not actually been serving on Enterprise at this point, but joined his friends when they were needed for the Nimbus III mission.
Nice theory, but again, it assumes that Starfleet officers are free to serve wherever they feel like. They're officers in a military hierarchy. They serve where they're ordered to serve.
By Star Trek VI, the crew wasn't really out on missions anymore, and it could be argued that Spock wasn't really part of the Enterprise crew. He was working with the diplomatic corps.
That much is true. In TUC, it was implicit that the crew hadn't been serving together regularly but had been reunited for this specific mission. That would've been made far more clear in the planned opening where Kirk tracks them down individually and recruits them for the mission.
It's really just the end of TVH and TFF that are a problem, and a credible explanation is the one BillJ proposed, or a variation thereof. I see it as Starfleet making the best of a problematical situation. "These seven people work exceptionally well together, but they're too insular and close-knit and too prone to go off and do their own thing, so we're better off keeping them together in one place rather than split them up and risk them being loose cannons."
Sometimes, though, I wish the movies had followed the path they were experimenting with in TWOK -- bringing in new Enterprise crewmembers like Saavik and phasing out the old guard. It would've been nice to have a movie series that really embraced change rather than one that made temporary changes and then reversed them one or two films later. It would've been nice to see these characters move on with their lives and adopt different roles throughout Starfleet rather than be stuck on one ship forever.