Lemon test, named after another case, means that there cannot be too close connection between official structures and religion.
Yet, in this case, the prayer was using school structure such as the microphone.
So, the court ruled this because the court believed that the students might have felt pressured to pray and therefore would not have a free choice to pray or not