After the first hearing on the government’s evidence for holding inmates at the Guantanamo Bay detention camp, a federal judge issued the Bush administration a sharp setback on Thursday, ruling that five Algerian men were held unlawfully for nearly seven years and ordering their release.