There is this thing called the 'Fog of War'. It means it is difficult to know all the facts in the chaos of war. If you somewho believe that everybody that was sent to Gitmo was a bonafide terrorist, no doubt about it you are fooling yourself.
How on earth could any group of people correctly capture and imprison every militant without error in the chaos of a Middle East fire fight in the middle of a city?
If we want to stand as a leader for justice on a world scale (be the policemen of the world), then we ought to afford captives some kind of a fair trail to weed out the guilty and innocent. To imprison them indifinately would be to go against everything we stand for.