That, and Pike has great confidence in Kirk.
In an insubordinate cadet with discipline problems and a history of civil involvements? Is it that he trusts Kirk, or who his father was? Shouldn't things like ability and training play into it?
Also, its probable that a lot of the crew, including many higher-ranking officers, are killed in the Enterprise's first encounter with the Narada.
There were plenty of commissioned officers on the bridge, including McCoy himself.
As for "not being qualified"... captain's discretion.

Yeah, I'm sure the tribunal would buy that fly as an excuse for putting someone unqualified in a position to command the ship. And McCoy and whoever was actually in the chain of command next would be right there next to Pike and Kirk at the court martial, provided they survived, of course.