Just going to be honest with you here, bud.
Here's the thing, she didn't fuck you over by dating your friend. Secondly, why would you ask a girl to a dance after she has already done something that caused you to lose respect/trust for her? The fact that she indirectly rejected you initially says it all, she's clearly just not that into you romantically. The fact that you continue(d) to make yourself available to her pretty much totally tipped the balance and dynamic of the relationship into her hands. Young girls LOVE to be valued, pursued, and chased. Teenaged girls are incredibly insecure, fickle, and in some cases manipulative. You are fulfilling an ego driven need for her right now.
Didn't you take it as a huge red flag that you two were hanging out and she wanted to go hang with her ex bf's parents?! That's a pretty clear sign, dude. Think about it....if she really just wanted to spend time with the parents, why wouldn't she do that at a time where she wasn't with you? She would've just made a lunch date, or swung by when the ex wasn't there. It makes no sense that she suggested to go there, let alone bring you! Holy shit that must've been crazy awkward.
I understand that you're young and a bit naive, but when a girl you're into and hanging out with invents reasons to visit her ex bf and his family, she's not over it. At all. Say this out loud: She wanted to hang out with his parents, the best way for her to do that is for us to watch a movie and cuddle with her ex.
Another thing, asking a girl to a dance and her accepting really doesn't mean anything. Not trying to be harsh, but it's reality. I feel like you read into her accepting the invitation more than was actually there.
As it's been said, you shouldn't be pissed at all, you should evaluate your actions and take steps to not end up where you're at again. Frankly, I'd go to the dance and seriously pull back from her immediately afterwards, unless you want to go through this same exact cycle, this time with another one of your friends playing the part of her current ex.
Good luck to you, I'm sorry this happened but we've all been there man. Question, are you and the guy not friend's because of this girl?