Hi jadekenworth,
So, let's get one practical thing out of the way first; it's totally common for cis guys to have trouble getting or maintaining an erection, and if he was also drinking that makes it even more likely. Him losing his isn't a sign of him, or you, doing anything wrong. You can read more about that here:
https://www.scarleteen.com/article/advi ... t_can_i_do.
I'm so sorry that your friend broke your confidence like that, and that this guy is responding to his own feelings of humiliation by trying to humiliate you instead (and that people are treating you badly as a result). If you want to talk about how to navigate the situation with the rumors at school, that's certainly something we can talk about.
What's more concerning to me is that you were under the influence to the degree that you can't remember the details of what was happening when you two had sex. Was he also under the influence? And was this the first time you've tried to be sexual in a situation like this, or was this a new experience for you?