this excellent article on the so-called "good soldier defense" -- which was mostly killed off by recent legislation. But:
Character evidence may still be introduced before sentencing at courts-martial, just as in the civilian system. And it is still allowed during the fact-finding portion of courts-martial for specifically military offenses such as desertion or disobeying orders.
That’s where its use began, [law professor and former Air Force officer Elizabeth L.] Hillman said, before the military courts gained jurisdiction of non-military crimes such as rape and murder.