Here is much more thorough article on the ruling.
http://www.metnews.com/articles/2005/fiel110305.htm
The district dropped the survey in 2002 amid complaints from parents, but several parents sued anyway.
This is important as the school system did respond to pressure from parents.
In the absence of a fundamental right, the districts survey needed only to be rationally related to a legitimate state interest to survive judicial scrutiny, Reinhardt said. Protecting the mental health of students and improving their ability to learn was a legitimate goal, he said, and it was not unreasonable for the district to think administering the survey would promote it.
This is where the judge erred, in my opinion. The schools are there to teach, not to give psychological studies to children.