People are still hung up on that line... (shakes head)
Look, Harry Morrow was Kirk's friend (probably from when he first became an Admiral, if not earlier). He was trying to spare his feelings.
What he was saying was "Jim, you've been attached to the Enterprise
for 20 years (more or less). It's time to let her go. You're an Admiral and a schoolteacher now. We (meaning the Admiralty) feel her days - and yours as captain - are over." That's why he said 20 years and not 40 - because that's how long ago Kirk took command.
That's probably also part of the reason the Enterprise
was decommissioned, in addition to her age and banged-up state. "We've never
gonna get this guy settled down as long as that damn ship's around."