I can only answer this question for myself. If I was to tell a co-worker that I was getting married. It would be to fend her off, in other words, a covert way of saying I'm not available... and not just on a boyfriend girlfirend level.. a HUSBAND WIFE level.
I think I can speak for most men when I say we don't usually say things that have subtext in the way that women do. We communicate differently. We're pretty straight forward. Unless this guy's a known manipulator, I'd say he was thinking the way I described.
Don't look too far into you're initiial question, If however, you don't like the flirting just say, "hey, that bothers me." If he doesn't care, then you can decide based on that what to do next. and that decision should include leaving, especially if this is something that would impede on your happiness. Why marry when you already know this will upset you and he's not going to stop because he doesnt care?