Why would a guy that wants to be just friends not mention his girlfriend?

I've known this guy for about 5 months now, and we have casual and flirty conversations from time to time. At first, I thought he was flirting with me because of all of his gestures. I would catch him staring at me, getting gradually closer when we sat together, teasing me, remembering little details about me, and having "accidental touching" moments. I thought he liked me because he showed general signs of interest, but whenever I initiated hanging out with him or gave him a compliment he would reject it or act negatively towards it. So of course, I just assume that everything that he did before that was just him being friendly since he shows no interest in getting together. He eventually adds me on snapchat, as I gave him my number since we were doing a project, and he starts to initiate all the texting and starts to ask me to hang out. At this point, I'm thinking that he probably does like me, but then he says one day that he just wants to be friends after I bring up going out on a date together. I accept the fact that he just wants to be friends and I accept the fact that being in a relationship with him is not an option. Today, my friend is talking about her new friend that she met at the gym and she shows me this girl on instagram. I start looking through her instagram since I'm curious to see what kind of person she is, and I find a picture of her and my guy "friend" with her explicitly saying that it's her boyfriend in the photo! He doesn't have any social media accounts so I had no idea about his personal life, and he doesn't post stories on snapchat. I thought that he just wanted to be friends because he wasn't attracted to me, I didn't think that it would be because he had a girlfriend. Wouldn't she have come up in conversation? It's obvious that I was clearly flirting with him if he had to mention that he wanted to be just friends with me. I don't get why a guy would not want to show off his girlfriend to other girls who are clearly interested in him.
Why would a guy that wants to be just friends not mention his girlfriend?
Add Opinion