There's even a footnote in the majority opinion where the Court specifically says, when Congress enacts limitations in a wartime context, normally the president is obligated to comply with them even though he's the commander in chief conducting the war.
NPR: Guantanamo Decision Puts President in Difficult Spot