Yay for jingoinism, nationalism and militarism!
This isn't a game of Ingress... you leave your post and your fellow soldiers could get killed. What he did was a clear dereliction of duty and you don't get a free pass.
At least two American soldiers were killed during the search operation to find him, and many Afghan civilians likely were as well. Now, his superior officers should have noticed his deteriorating mental state and had him pulled out of the combat zone, but the fact remains that he deserted his post and men died needlessly looking for him.But that's exactly why the military charged him, so it can avoid the blame. They kept a mentally ill person in a military zone, until he did something deeply self destructive and irrational, so if he's not blamed, his superiors and the system would be blamed for failing him. So of course he needs to be punished.