Cooking someone a meal doesn't mean that for the entire time they're at your house they have to put up with however you treat them. Even, (shock horror) a vegetarian option. 40 minutes must have been about half the time they were there. You're supposed to make your guests welcome and the evening enjoyable, not just cook.
The fact that the OP says her DH and this man were 'talking amongst themselves' during her 40 minute rant shows that even her own DH had got bored and tuned out and this poor woman was stuck listening because she was trying to be polite.
I may be projecting a bit but I've had friends like this in the past. All they want to do is hold forth on themselves and their problems. They're not concerned that what they say is interesting for the listener who is literally just a prop for them to partake in their favourite hobby which is talking about themselves. They aren't interested in their friends problems or what challenges their friends have faced, they just want to bore on about themselves for their own satisfaction.
The OPs dogged determination to insist how endlessly fascinating listening to her bore on for work is does make me suspect that is the case here. It was a Friday night, they'd probably both had tough days at work themselves and felt like relaxing, not listening to someone drone on and on about how hard done by they are. And people who do this once tend to have a habit of doing it.
The fact her friend just drunkenly smiled makes me think she probably got in the car and said 'Well done, I've wanted to say something like that for years.'
Sorry OP, yes he was rude. But I really think that the posters on here who are telling you that you shouldn't be considering how your own behaviour contributed to the situation are wrong.