Early in the conflict in Afghanistan, U.S. forces brutally and with a great deal of heroic action in combat shut down two suspected al-Qaeda bases there, killing dozens, and capturing dozens more who were tortured during their interrogations afterwards.
The problem: the bases actually belonged to two of the strongest leaders of our allies.
In hindsight, this raid seriously hurt the U.S. cause in Afghanistan. But, due to bad intelligence and an imperative to act swiftly we didn't know any better.
The Special Forces troops involved did engage in some unprofessional overkill in their methods, but no one would have faulted them for that if the situation had been as they believed it to be (and indeed, several of the men involved in the raids won military honors as a result of their actions in those raids). However, our poor intelligence on those raids undermined the U.S. campaign in Afghanistan for years to come and may be one reason that the Taliban is still a viable insurgent force even today.
We need to avoid those kinds of mistakes in future conflicts.