The Court's reasoning is probably that the school has unwittingly provided this kid with a captive audience to preach to. Consequently, they are de facto endorsing the child's religion.
This would follow from the line of caselaw which holds that students can organize Bible study groups during non-instructional time, because nobody's being forced to join or pay attention. But a teacher can't lead a prayer, or let a student give a public prayer before a football game, because the school is implicitly giving sanction to that prayer by providing it with a captive audience.
Only the CONGRESS is prohibited from establishing any religion according to the Bill of Rights, Article I. U.S. Constitution. There is NOTHING in the Constitution that forbids or prohibits schools endorsing or promoting a religious precept, we have done so in America for the better part of 200 years without problem until the last two to three decades by a minority of morally-devoid relativists and Activist Judges.
This would follow from the line of caselaw which holds...
Ahhh, now we come to it...CASELAW. Sorry, according to the Constitution itself, CASELAW is NOT law - except by those whom accept the whims of a Judge as the Ultimate Lawgiver, which the Supreme Law of the Land prohibits. ONLY CONGRESS can make law - the Judiciary is to rule UPON WRITTEN LAW PASSED by the Legislatures, or to measure a case based upon the written laws, not "interpret" law as they see fit to mean.
But since Americans are now ignorant of our very Foundations, and we have left the running of the Republic to the "professionals" and the High Priesthood of Secular, Humanist, Liberal Lawyers - we have defacto law of judicial precedents being accepted as "law".
Wonder how long and how comfortable all of you are going to be when some Judge rules that political speech that is hostile to the Administration or government is subversive and therefore not 'protected' and can be prohibited? Once that precedent is set, imagine all the laws that will stem from that false foundation.