Judge says it is discriminatory and violates students’ and parents' legitimate expectation.