Guys, Why would he say "stay in touch" if he has a girlfriend?

I met this guy professionally and I felt we had great chemistry - he encouraged me to stay in touch from the start. He is very responsive when I reach out asking for his help and so sweet. We spoke a few times and so I asked him to meet for coffee as I enjoyed talking with him. At this point I did not know he had a girlfriend. I did ask him what he was up to on weekends and he never mentioned anyone. When I asked to meet for coffee, he did not clearly answer, but then told me to "stay in touch". I found out about his girlfriend on social media because she tagged him in a photo. Why wouldn't he just tell me he has a girlfriend when I asked him for coffee when I have clearly been flirting with him and he appears to reciprocate the interest but won't actually escalate anything? It had me confused. I was beginning to feel like I imagined things or that I did something wrong. If he wasn't interested, I would have imagined after I asked to meet up, he wouldn't encourage further contact by saying to stay in touch? And now I am confused as to whether he genuinely wants to be in touch but doesn't want me to know about his girlfriend? He could have simply mentioned her when explaining his plans over the weekend that she tagged him in. FYI, he does not know that I know about the girlfriend.

Guys, Why would he say "stay in touch" if he has a girlfriend?
Post Opinion