What does the United States military gain by doing this, exactly?
You can't just wander off with no reason when you're in the military. And, the military is kind of a stickler for rules and discipline for whatever reason.
It's just that getting held captive by the Taliban for four or five years or so would fit most people's definitions of 'having suffered enough' and then some.
I don't agree.
Bergdahl clearly seems to have blatantly deserted. And, he caused enormous suffering for other people. He put his family through horrible suffering. He put US troops in serious danger when they went to look for him, potentially leading to several deaths. And, he caused us to exchange 5 Taliban prisoners for him. I'm sure Bergdahl suffered, but it's entirely his own fault.
The only defense I could think of is that he is mentally ill. If he has severe psychiatric issues, I think maybe you can give him a lenient punishment. But, I absolutely think he should answer for what he did.