Finding it a bit puzzling you're friends with this guy when you like his girlfriend. Why are you hanging out with the guy who is nailing the chick you liked? I'd feel crap hanging around like a hungry dog in that situation, I'd rather get a new social circle and find new people.
And why are you bothered by what she's doing anyway? She's not giving you any attention, don't give her any thought.
Also girls lose rationality once they're attached to a guy. I've seen girls still dreaming about dating some guy that treated them like s*** 5 years ago. Who cares why she's into this guy, move on and nail some other girl.
In fact, go nail some girl that your friend is really into, and see if he hangs around being your buddy afterwards. I'm guessing not.