Similar to the "corporate organization" comment above, I tend to view Starfleet less as a strictly by-the-book military organization, but more of a NASA/NOAA/Navy hybrid. It's principally a research organization with aspects of a military (that are only rarely called upon except in a crisis*). Since we really aren't shown much of Kirk's career at the academy, it could be that he's one of the best candiates they've seen in years when it comes to commanding a research ship, and his ability to function in a crisis was proven by the Nero incident.
* = it's probably argueable, based on Marcus requiring Khan's "savagery" in STID that he at least believes that Starfleet has gone soft. Compound that with Carol's comments in TWOK that Starfleet has kept the peace for one hundred years, which seems to imply the last hot war was against the Romulans, so I can see the "military" side of thing eroding even further in Starfleet over that time.
* = it's probably argueable, based on Marcus requiring Khan's "savagery" in STID that he at least believes that Starfleet has gone soft. Compound that with Carol's comments in TWOK that Starfleet has kept the peace for one hundred years, which seems to imply the last hot war was against the Romulans, so I can see the "military" side of thing eroding even further in Starfleet over that time.