Guys, why did he hide that he has a girlfriend?

We are studying in grad school together. We have been good friends in the past 6 months and have been texting pretty much every day since the last 3 months. We would text day and night, study together, support each other during rough times and discuss the details of our daily lives.
He would even let me know of what he is doing when he is travelling. Last week I learned that he has a girlfriend and was shocked. When I asked him why he didn't tell me he became defensive and angry and told me he would tell me but I never asked. I am pretty sad and and feel insulted because I liked him a lot and feel that he was hiding it on purpose, especially because he had so many opportunities to tell me. I stopped contact with him immediately but I still cannot understand what his intentions were as he always avoided going on a date with me or he never made things physical. I believe that if we were only friends I would know about it. What do you think?
Guys, why did he hide that he has a girlfriend?
Add Opinion