The reasoning behind this case was that students have First Amendment rights even when they are at school.
This is not to say that the Court was ruling that schools cannot limit student speech in schools. However, schools cannot simply infringe on student speech unless they have a very good reason to do so. In order to infringe on speech, the school has to show that the speech would have a serious negative impact on the school's ability to maintain discipline and keep up an atmosphere in which learning is possible.
So, the main reasoning is that student rights to speech should not be infringed upon unless there is a valid educational reason to do so.