Ah, but you see that's the flaw in your reasoning. Kirk doesn't deserve the Enterprise back. He simply doesn't. And so he chooses to pull rank. It's a reflection on Kirk's character that he must have the Enterprise at any cost, even if it means becoming what he hates: admirals who have exaggerated opinions of themselves (seen in "The Deadly Years") and admirals who pull rank (Admiral Komack in "Amok Time"). He's become BOTH.
The thing is when you read GR's novelization of the film it fills in a lot of gaps in the movie. We learn that Kirk was basically strong armed into accepting his promotion. He was drained after an exhaustive 5-year mission and got blindsided. If he'd been on his game it's more likely he would have resisted a promotion to remain in command of the
Enterprise and overseeing her refit.
Kirk's behaviour early on in the film supports the background given in the book, but the necessary scenes the would show it are missing from the film. Maybe all we would have needed was that brief scene at the beginning where Kirk confronts Admiral Nogura to get command of the
Enterprise and then his behaviour would make more sense onscreen.