He's flirting with you and staring at you because he still has feelings for you.
Now maybe he's sublimated them pretty well, and maybe he hasn't. But the fact is, that when you break up with someone, it doesn't mean that the aspects of people you found attractive are suddenly gone. There are lots of reasons to break up with people.
So here's this guy you were dating and you and he broke up. Did you guys break up together, or did you say you wanted to go back to being friends and he was supportive? I take it he wasn't the one that broke up with you?
Anyway, if he still cared about you (which he obviously would in the situation above) and he agreed to go back to being friends, it's because on some level he feels you may get together again. It might not be a conscious decision, but it is what he's thinking.
When my ex-fiancée and I broke up, I was a wreck for a few weeks because that's a really painful situation, but even after I was okay with it and even after I said "This is probably for the best." I still wasn't REALLY over it. I had come to a place where I was functional and not thinking about things all the time. That's not the same thing.
The first time she flirted with some other guy, even though I knew her well enough to know that she would never do anything with that guy and that even if she did, it was her decision, even with all of that, when she flirted with some guy it absolutely KILLED me.
It was more infuriating and frustrating than the break up itself.
Feelings don't just go away. Even if your guy is determined to be there as a friend and even if he works really hard to push all that emotion down, he still thinks of you as "his."
You mentioned that he has a girlfriend. So what? She's not a REPLACEMENT. She's something COMPLETELY DIFFERENT.
You can't be replaced. You're his and he will always have some feelings for you.
His new girlfriend is a separate issue as far as he's concerned.
I hope this helps.