I recently listened to an NPR bio of McCain,
What I heard may help to answer your question Kendall.
The ranking at the naval academy was not just based on grades. A big component was leadership. A big part of leadership was behavior and setting the proper example. He lost a lot of rank for misbehaving. That is not to say that his grades were any great shakes. He got very low grades in subjects he did not like. He would skip class, refuse to study and cram in the days before his exams.
He is certainly smart enough to be President and unlike the previous Republican standard bearer, he has a reputation for being well read.
He also has a reputation for being rash and hotheaded. He admits to having made rash decisions which he has regretted and admitted later. He says he takes full responsibility for his bad, rash decisions, That also makes him a better man than Bush. But wouldn't it be better if we had a President who will measure twice and cut once?