Stop in for a cup of coffee

Sets a very dangerous precedence.
I don't think so for 3 reasons.

The first reason is the five years Bergdahl spent as a prisoner of the Taliban.
Bergdahl mounted a number of escape attempts after which he spent years confined in a cage suitable for an animal. He was tortured, beaten with thick rubber hoses and copper wire.

The second is his diagnosis of schizotypal personality disorder. Some evidence for Bergdahl's strange mindset is provided by his observation to the podcast "Serial" after he was released by the Taliban that when he had left his base in Afghanistan he believed he was on some kind of "Jason Bourne" mission. Moving around alone in Taliban areas in Afghanistan, Bergdahl proved an easy target for Taliban foot soldiers, not some kind of action hero.

The third reason is that Bergdahl provided useful information about the Taliban to US intelligence agencies when he was debriefed.

There are mitigating circumstances in every case when it comes to sentencing, it's not an absolute black-and-white interpretation of the law. In this case, I can't complain that the man got away easy and while his sentence could have been harsher, no further justice would have been served by making it so.