He just likes drama and is a jealous person. Ignore his stupid comments. They are of no value to you.
A guy in my class is always bugging and rude to me. I ask him why, he says I stole my boyfriend away from him. But they aren't even close friends. What do you think is his problem?
Is your boyfriend bisexual? That's the first question I have. The second comment I have is that you should tell your classmate that people are not possessions - they are people. Your boyfriend can be with whomever he wants to and can be friends with anyone he wants to and that you are not here to argue over your boyfriend's preferences.
He should talk to the boyfriend directly and quit trying to start trouble between you two. You say all this with all due politeness - no need to get snarky over this situation. If he says anything else, just smile and put your attention to the class, not him.