Well, it could be that Harley has some exciting news to share with Peter right in the middle of class. It might be about a new superhero sighting in the city or a cool gadget he's discovered. And he just can't wait until class is over to tell Peter.
Perhaps Harley calls Peter in class because he noticed something strange or dangerous. For example, he might have seen a suspicious character lurking around the school. He calls Peter because he knows Peter has a sense of responsibility and can handle such situations. He wants to quickly inform Peter so they can figure out what to do together.
In this fanfiction, Harley might be calling Peter in class to ask for help with a difficult assignment. Maybe Peter is really good at a certain subject and Harley is desperate for his assistance during class time.