If you have evidence that they will do us harm you might have a case. But many of those at Gitmo were brought there because of no such info.
If you have evidence that they were training terrorists or training as a terrorist that is one thing. But are all the detainees under that reasoning?
Check to see how many were brought there because of the uncorroborated information from sources that cannot be checked and may or may not be verifiable.
The problem is we are not dealing with "traditional" criminal activity. The military are not over there to do the job of LEOs. They are there, like it or not, as an occupying force whose purpose is to minimize as much as possible insurrectionist and terrorist violence.
Certainly if a person is captured in a firefight, having fired on our troops (and survived) they are by definition, an enemy combatant. In fact, they are technically non-uniformed enemy combatants, which places them outside even the general protections of the Geneva Convention, let alone the U.S. Constitution. In fact, by laws still on international books (including the Geneva Convention) non-uniformed enemy combataants can be summarily executed. Since we are not doing that, then the answer "they will be let go when the farcus is over" is about the best one we have available. They are functionally POWs even though technically they are not. Thus, the answer to this particular class of detainee is, yes, it is OK to keep them locked up indefinitely without trial.
For those detainees captured in a raid, based on intel, then they are not, technically, combatants. But they are not, technically, criminals, either. Being they are not criminals, they do not (nor should they) have the rights we grant criminals being held under indictment in our system. Being they are not enemy combatants, they have more rights than POWs.
Now what SHOULD happen is these people be processed through military tribunal, as the capture and purpose of capture was military in nature and purpose. The military (either by order or by lack of resources - I suspect the former) fell down on the job, and did little nothing to determine the actual status of the detainees. Had they gone through the proper procedure for processing enemy civilians in a combat zone - procedures that have been in place since WWI - none of this crap would be at issue. They could have let go, within a few days, those who were captured but did not have significant evidence of combatant activities, and sent on those who did have evidence against them, and thereby classifying them as enemy combatants, to be treated as such. And what does THIS mean to your base question? The answer is, once again, "yes", with the modification that we do have the obligation to release ASAP through military tribunal anyone who cannot be corroborated as an enemy combatant.