There's no clear just way to view the entire situation. Though Assange was unreasonable to call them all "spies and traitors", if that's what he did.
I'm not sure if you meant to defend him but that describes Julian Assange's own situation pretty well.
- killing people by bombings
- locking people up without usual safety/legal process regards, and torturing them (either directly, or by having a pretty nasty jail)
Innocent people are often killed, and locked up. This is not some precise process.
Also being an informant druing war for one side is not the same thing as being an informant for police in the peaceful western country, or informing on curruption via leaks. These are wildly differing contexts.
You can't view informants with high regard, unviersally. People will falsely report on neigbours, to settle some past grudge, because they know trigger happy Americans will bomb/storm the place, if they can make the story plausible enough. Even if you assume good reports, bystanders get killed, or snatched up too. And through all this you have to still assume us-vs-them mentality, that all Taliban members are bad, and informing on them is good.
So there's a grain of truth in the view that was ascribed to Assange, above. But it's unreasonable, to go full way, and make all informants be traitors and whatnot.
There's this book, that makes good points about the complexity of the situation in Afghantistan, and the US intervention:
Sorry, no. The US has terrible foreign policy, yes, but religious fanatics like the Taliban are a cancer on humanity. They seek to keep women as chattel and murder homosexuals and anyone else that doesn't conform to their insane ideology.
Anyone who informs on them is a hero, and people like Assange who go after them are villains. It's no coincidence that Assange is buddy-buddy with racists like Sean Hannity (https://www.independent.co.uk/news/world/americas/julian-ass...). He just wants to be in the news, and doesn't care if he has to stand side-by-side with fascists, racists, and religious fundamentalists to get there.
On the other hand, the Taliban seeks to keep girls out of school, treat women as chattle, throw homosexuals from rooftops, eliminate the Hazara people, behead apostates, and stone adulterers in football stadiums. Lots of people in Afghanistan hate them, and would inform on them to protect themselves and their loved ones, at a level of personal risk which neither you nor I can likely comprehend. So there's that.