Even though he is a guy who has a girlfriend, he doesn’t believe this precludes him from being flirty with a girl.
If anything, he didn’t see anything morally wrong in flirting with you, as he already knew he had no intention of taking matters any further than flirting.
This is how he sidesteps having to contend with a guilty conscience or any culpability in flirting with you or any other girl.