Your close friend has probably had feelings for you for a while but never let you know about them.
He may be dating somebody else at the moment but that doesn’t necessarily mean that this is the person that he actually wants to be with.
Oftentimes in friendships, one party likes the other in a romantic sense but they never let the other know out of fear of how the friend will react.
In your case, he may have liked you for a while but was too worried or afraid to let you know.
Hence, he started dating someone else because he felt that you probably didn’t like him romantically or that he just didn’t have much of a chance with you.
In the process of dating this other person, he has now come to realize just how much he wants to be with you to the point that he is willing to sabotage his relationship with this other person in order to be with you.
He may have also gotten into this relationship in order to make you see that he is a catch and that other people can be attracted to him.
In other words, he may be in this new relationship so as to get your attention and possibly even get you jealous.
Hence, he may be actually using his current partner as a ploy or ruse to get you to start yearning for him romantically because you just can’t stand the fact that he is seeing someone else.
These are some of the most common reasons why a close friend would start flirting with you when they are already dating somebody else.
He is a close friend, so he has gotten to know you over the course of time.
Over that time, he has discovered similarities that he may have with you in terms of hobbies and tastes.
He has gotten to see more and more of your personality.
He has probably shared affectionate moments with you where it was just the both of you hanging out together as close friends.
He has gotten to see you at some of your lowest points where you were relying on him for his emotional support.
He has also perhaps gotten to share some of his lowest points with you as well and experienced the kind of support that you can give someone that you hold dear as a close friend.
All of these occurrences in the past can easily start making at least one member of this equation begin to develop feelings for the other.
It happens quite often. However, that member of the equation will often not tell their friend about how they feel about them.
There is a good chance that he has been having these romantic feelings for you for a while and perhaps was waiting on you to see if you would show him any signs that you feel the same way for him romantically.
He never got those signs and consequently decided to date someone else.
However, in the back of his mind he has probably continued to hope that you would eventually come around to liking him romantically.
He flirts with you now because he has the cover of being in a relationship to fall back on just in case you ask him why he is doing it.
He can always say that he is just having fun, after all, he already has a partner.
However, that would most likely be just a smokescreen for his true feelings for you.