A charge not often seen in modern times, it was common during WWII:
RALEIGH, N.C. — Military prosecutors have reached into a section of military law seldom used since World War II in the politically fraught case against Army Sgt. Bowe Bergdahl, the soldier held prisoner for years by the Taliban after leaving his post in Afghanistan.
Observers wondered for months if Bergdahl would be charged with desertion after the deal brokered by the U.S. to bring him home. He was — but he was also charged with misbehavior before the enemy, a much rarer offense that carries a stiffer potential penalty in this case.
"I've never seen it charged," Walter Huffman, a retired major general who served as the Army's top lawyer, said of the misbehavior charge. "It's not something you find in common everyday practice in the military."
Bergdahl could face a life sentence if convicted of the charge, which accuses him of endangering fellow soldiers when he "left without authority; and wrongfully caused search and recovery operations."
Here's the pertinent article under the UCMJ:
899. ART. 99. MISBEHAVIOR BEFORE THE ENEMY
Any person subject to this chapter who before or in the presence of the enemy--
(1) runs away;
(2) shamefully abandons, surrenders, or delivers up any command, unit, place, or military property which it is his duty to defend;
(3) through disobedience, neglect, or intentional misconduct endangers the safety of any such command, unit, place, or military property;
(4) casts away his arms or ammunition;
(5) is guilty of cowardly conduct;
(6) quits his place of duty to plunder or pillage;
(7) causes false alarms in any command, unit, or place under control of the armed forces;
(8) willfully fails to do his utmost to encounter, engage, capture, or destroy any enemy troops, combatants, vessels, aircraft, or any other thing, which it is his duty so to encounter, engage, capture, or destroy; or
(9) does not afford all practicable relief and assistance to any troops, combatants, vessels, or aircraft of the armed forces belonging to the United States or their allies when engaged in battle;
shall be punished by death or such punishment as a court- martial may direct.
So it's a serious charge, fully as serious as desertion, and a signal that the Army wants to send a signal to other narcissists that aren't serious about their duty.