I have not seen this episode in ages, but some things stand out in my memory.
Stocker's referring to Kirk as "sir" is simply courtesy with aboard ship. Stocker clearly respects Kirk for taking him to Starbase 10. The Enterprise, is after all, Kirk's command. Stocker seems to show almost reverence for that. Add to that, Kirk is a starship captain, while Stocker is indicated to have been a "chair-bound paper pusher". In an organization like Starfleet, is seems natural that starship captains are held in special reverence just for serving in those positions. Remember what Stone said to Kirk in the first act of "Court Martial" about commanding a starship:
STONE: Then why, Captain, does the computer log from your ship, made automatically at the time, indicate that you were still on Yellow Alert when you jettisoned and not on Red?
KIRK: I don't know. There's been a mistake.
STONE: It would seem so. Could the computer be wrong?
KIRK: Mister Spock is running a survey right now, but the odds are next to impossible.
STONE: Stop recording. Now, look, Jim. Not one man in a million could do what you and I have done. Command a starship. A hundred decisions a day, hundreds of lives staked on you making every one of them right. You're played out, Jim. Exhausted.
KIRK: Is that the way you see it?
STONE: That's the way my report'll read if you co-operate.
(Note my emphasis in italics.)
Clearly, this episode underscores that Starfleet's record, to this point, is flawless in promoting and assigning its best command-track officers to positions of starship command, "a valuable commodity".
What is strange and ironic is the suggestion that Stocker, already a commodore, is being assigned to command an entire Federation starbase, just like Stone (another starship command veteran) yet Stocker supposedly has no such command experience himself. This makes no sense. Why would the Federation, with such a flawless record, allow an inexperienced officer to such a position and rank? This would clearly contradict the reputation that the show had built up over the previous year-and-a-half for starship commanders, that they are a cut above even those astronauts who have the right stuff. Surely, command of a Federation star
base would be treated much the same as a star
ship.
The only conclusion I could reach is that Stocker's actual record was never discussed in earnest, and therefore Kirk's rant about him would be unwarranted. As for Stocker getting in over his head with the Romulans, this seems ridiculously uncharacteristic for any command-grade personality in TREK. We've seen TOS-era authority figures that are corrupt, perhaps influenced by diseases or other issues that could affect their ability to function or exercise proper command judgement, but never before this episode have we seen dangerous incompetence in command ranks without extenuating circumstances.
If we accept that Stocker was being portrayed as being in over his head, then this had to be the writers' way of showing how some military figures can disappoint in a time of crisis by having been promoted far above their true abilities and/or experience. There was a string of generals in the early Civil War that, history tells us, were not up to the command challenge. But this notion is obviously at odds with the spotless reputation that TOS had repeatedly manifest around command.