"I have no problem with the penalty that is being imposed on him for knowingly taking up arms in support of a repressive foreign power" - so if some young American goes to live in Israel, and joins the Israel Defence Force and comes back to America he can expect to be banged up for life? I rather doubt it.
Afghanistan was not at war with the USA when the lad went out there and joined up. There hadn't been any September 11. The Taliban regime was being actively supported by a country with which the US is pretty friendly with, Pakistan, and being actively opposed by a country the USA feels hostile to, Iran.
The fact that the Taliban was a remarkably unpleasant regime, in some ways even worse than that in Saudi Arabia, is neither here nor there.
There's going to come a time when this whole thing will be one of those bits of history people are very embarrassed about. And they'll say "It's easy using hindsight - but at the time people couldn't be expected stand back and see it that way." Steve Earle's song is maybe going to be a bit of evidence that some people could.