The prisoners kept there were picked up after attacks on US/Allied forces on battlefields or in areas immediately adjacent. Non-state combatants are not protected by the Geneva Convention, and the treatment of non-state prisoners was historically battlefield execution.
Some of the (innocent) noncombatants were released after investigation. The remaining purported noncombatants chose to boycott their trials.
Of course it would be easy to release them to US if other countries refused. But instead of that US rather kept innocents locked up for years, out of convenience or whatever.
I think continued detention after you're determined to be innocent, is quite bad. Also if I make a mistake and lock you up and torture you for years, just releaseing you is not really justice.
Is it really that hard to read up a wikipedia page on Guantanamo bay for americans, if not a book or two? There's enough info just on wikipedia's main article and some linked articles from there to make your skin crawl.