Obama on Day 1 od his Administration in Jan 2009 signed the order to close Gitmo within a year. Every politician with self-interest at a premium said NIMBY (not in my backyard). So Obama decided to swap the 5 most dangerous Gitmo Taliban for a soldier to whom Band of Brothers may not seem so true to many Soldiers.
What a brilliant move to close Gitmo by Presidential fiat - like signing the Dream Act for immigrants. Congress refuses to act? Obama will use Executive powers. Lincoln used to twist opposing Congressional arms. Obama uses smarts. He's accused of not being collegial (hanging out with Congressmen), but he's smart enough how to play their game. Gitmo will close when there is no more Taliban and Al Qaeda there.
There is also a political plus. The Taliban has been getting stronger over Karzai whose corruption doesn't help. So Obama is checkmating him by handshaking with the Taliban. It's only Politics as Cranston would say (he of Breaking Bad fame).
The military always get its wounded and those in prison; even if they are deserters, because they want to deal with deserters themselves.
Obama has beaten these knuckleheads over the debt ceiling. Look how they will run around chasing their tails to make this swap another Bengazi.