I went to counselling at the beginning of this year and one of the things that was brought up was how I flirted a lot. But it is just my personality. It is who I am. Hell, I even flirt with my mother. And I have no intentions of getting it on with my mom. But that is how I was raised. I never thought of flirting as a bad thing. Infidelity, yes. But not flirting.
Flirting is an act that we can share with a stranger to boost egos and make us feel good. I don't see why that would be wrong? And that stranger just might have a significant other, but it doesn't mean flirting has to stop.
Like others have said, flirting is okay if it doesn't go past that. But then it wouldn't be flirting. But if you want to dig deeper, maybe you should look at the different types of flirting. . .
Softcore Flirting - Cute Compliments, batting of the eyes, exchanging smiles, winks.
Suggestive Flirting - Making gestures to sexual acts, kissy faces, licking lips, sucking on fruits, or breaking the personal bubble like footsy...
Hardcore Flirting - Talking about actually doing things together sexually, more physical interactions like slapping an ass, sending dirty pictures...
Softcore flirting I believe is extremely harmless. I think it is the purest form of flirting and is very much okay, whether you are with someone or not. I think this is even other when with someone who is jealous because these are simple interactions. They do not have to be taken for more than a friendly exchange. If you are with someone that is jealous for you smiling back at someone that is smiling at you, you might what to get out, or have a talking with them, because jealousy over that is unhealthy.
Suggestive Flirting is where the barrier can be crossed in my opinion. Who you are and who your significant other is or the other person's significant other is plays a big role on if this would be considered okay. I wouldn't flirt with someone who has a possessive or jealous partner. Not only could that be stirring up shit, but I could be causing them to get into arguments and that is not what flirting is supposed to be for. However, given the right people and their relationship with their partner, this could okay.
Hardcore flirting is wrong to do with someone else's significant other unless there is an understanding, like an open relationship or anything of those sorts. And if you are taken as well and flirt with other people in that manner behind your partner's back, that isn't right either.
So all in all, I believe it depends on the type of flirting that is going on. That's my two cents. ^_^