The simple answer is no. Your agreement with Apple is for personal use:
- You may use the Services and Content only for personal, noncommercial purposes (except as set forth in the App Store Content section below or as otherwise specified by Apple).
Legal - Apple Media Services - Apple
The question would be is a classroom more like playing music at your house where you have friends come over and listen or like a restaurant or business where Apple Music is playing in the background. You will find many similar discussions on the internet with opinions, but Apple is not here to answer your question, so if you wanted to get a definitive answer from them you would have to reach out using the link below for contact.
Copyright law does have some specific exceptions such as the Fair Use Doctrine and for Educational use for plays or musicals, but that would be specific to copyright infringement of the artist's work, and has nothing to do with the agreement you made with Apple for use.
The contact page for Apple Legal is available here:
Legal - Contact Us - Apple