Listening to every heart
I think his girlfriend has a problem with me and that is part of the problem.
As an outsider watching this unfold via one side only, I would hazard a guess that your friend's girlfriend is jealous of you, and that your friend's biggest problem is in being forced to make a choice...and apparently it is not one that he is happy with, ergo, his "unhappiness" comes to light.
Being a friend is hard enough...but being a big enough friend to know that sides are being taken, and you are not on the side you wish to be...that's going to be the hardest part not only for your friend, but for you, as well.
I would hazard a second guess that your friend is being told in no uncertain terms how to conduct his life, and his friendships, by his girlfriend.
And when the veil of "love" is applied, there is little you can do at this point, but to know in your heart you were there for your friend when it counted, and that friend fell short of being able to maintain friendships AND a love life.
If, and most likely, when things turn around, and you find out that your friend is available again for companionship, don't be surprised if your friend is uneasy in making an apology for the rude behavior that has been exhibited to you.