The majority of married men flirt to feed their desire of being wanted. Even though he's married, he wants confirmation that he's still attractive. He wants and needs a boost to his self-esteem, ego, and confidence. It may be that he doesn't feel wanted or desired by his wife.