But the decision by the Court could spell trouble for a growing number of US school districts that have lately begun experimenting with single-sex classrooms, urged on by experts who say they can improve academic performance for both girls and boys.
The state-run Virginia Military Institute has fought a long, rear-guard battle in the courts to keep women out, even as women have joined the ranks of the US military in increasing numbers.
Justice Ruth Bader Ginsburg, who framed the opinion adopted by a 7-1 majority on the Court, conceded that single-sex education may benefit some students, because education "is not a one-size fits all business".
But separate classes should only be considered where there is an exceedingly persuasive justification that they work, she wrote. They must not rely on over-broad generalisations about the different talents, capacities or preferences of males and females.
A recent survey by the US General Accounting Office confirmed a growing interest in single-sex education, in what appears to be part of a broad return to traditional teaching methods in the face of high drop-out rates and poor grades.
However, courts since the Second World War have taken a large role in outlawing discrimination by race and sex in schools and other areas. The Supreme Court's ruling worsens the legal atmosphere for single-sex programmes at a time when they appear increasingly popular.
Since the turn of the century most US schools have been co-educational. But several recent studies suggest that single-sex education may help, in particular, teenage girls squeezed out of classroom participation by more aggressive boys, and minority schoolchildren of both sexes.
Other factors - such as the smaller classes and increased teacher time commonly associated with special single-sex programmes - may be skewing survey results, experts caution.
Virginia recently passed legislation allowing state schools to open single-sex classes. The Republican Governor of California, Pete Wilson, recently proposed single-sex academies for students at risk of low achievement or dropping out. Nationally, several similar initiatives have come before the US Senate.
Several US school districts already have single-sex schools or classes that exist in a legal grey area; while they do not officially bar pupils of the other sex, they are not invited to apply. Others have mentor clubs designed exclusively for girls and boys.