Yes, flirting while married is a sin. The Bible is clear that we are to remain faithful to our spouses, and this includes not flirting with other people. Flirting can lead to adultery, which is why it is something that we should avoid.