Having listened to the ten-part podcast series about this very topic, I really think that Bergdahl was an incredibly naiive and sheltered young man. When you hear about the writings in his journals, its clear that he thought of himself in grand, Homer-esque terms. He thought that Afghanistan was going to be his Odyssey, when really it was more like his Ulysses. I don't think he had a very good grasp of the repercussions until he got caught.He did make a stupid decision but he was not a young and dumb soldier. I believe he understood the repercussions. Someone said it, but soldiers get dishonorable discharges for a lot less harmful offenses in garrison.
Give it the series a listen sometime, it's very enlightening: Season Two