Why would a guy who previously seemed interested avoid and blank a girl?

There’s a guy in my wider friends group who seemed to really like me, we got to know each over over a year, got close, but then I found out indirectly (via another friend) that he actually has a girlfriend who he met three months before me.

Now when we see the friends group he acts avoidant, looks down and doesn’t even say hi. I’m not looking to cross boundaries, but is it that hard to be civil? He acts like we are strangers. He doesn’t know I know about her. Why is he like this?

Why would a guy who previously seemed interested avoid and blank a girl?
Post Opinion