As for abuse endured during his captivity, Bergdahl could have avoided it by remaining at his post. He wasn’t captured doing his duty. He quit and walked away.
The only military sin graver than desertion in a combat zone would be to turn one’s weapons against one’s fellow soldiers. What Bergdahl did was a cardinal sin in any military. But, despite constant refrains of “Thank you for your service,” military values are despised, mocked and attacked in our society.
As for any alleged mental problems influencing Bergdahl, a psychologist can make the case that any human being is disturbed. But Bergdahl was rational enough to plan his desertion, to mail home his personal computer and effects. He knew what he was doing.