My classmate is gay and I accidentally ousted him to the entire class.
What makes you think she's gay?
Because she has no boyfriend at the moment.
I personally don't think that's a big deal. If she was hiding the fact that she's gay, you should apologize.
She's not gay but in denial.
You should just apologize for what you said, because it sounds like you don't even know if she is gay. You would make a friend instead of an enemy if you just show a little bit of humility here.