Was he with his girlfriend before he started flirting with you? If so, it is possible he preferred you to his girlfriend at the time he was doing that. But even if that was the case, would you honestly expect him to be faithful to you when he was not faithful to his ex? As soon as he thinks he can 'upgrade' he would do the same thing again. A leopard cannot change it's spots.