Why would a guy flirt with his friends crush?

Guy A picked up on the fact that guy B likes me. A has no interest in me since he avoids me most of the time and seems visibly disinterested in talking to me when we are alone. However in presence of B he tries to get all my attention and flirts with me. Why does A do this? He is married by the way

Why would a guy flirt with his friends crush?
Post Opinion