Per Jay Carney, American equivalent of Baghdad Bob, the Taliban are classified as "enemy combatants."
From the story linked above:
"We regard the Taliban as an enemy combatant," Carney said, adding the swap was consistent with U.S. policy and past prisoner of war releases throughout armed conflicts. "This was the right thing to do because we, in the United States, do not leave men behind."
Based on that comment from the story, I'd say that they have designated the Taliban captives as prisoners of war. So, I'd say they've been "classified" so that they could do an otherwise illegal swap with terrorists.
Except we have given them none of the rights they are due under the International laws the US has signed on to that comes with the POW designation.
Yeah, there is something wrong with the way he was "captured", and it seems like it is being overlooked.
It sounds like he was a Taliban sympathizer and he walked off his post to join them, and several Americans were killed trying to find him.
From all accounts, he wasn't so much a sympathizer as he was just a dumbass. The inevitable result was his capture, but I don't think that was his intent.