that's what the opening That's refers to.
He's saying that some men are afraid of being rejected and don't have the self-assurance to have a pleasant conversation with a woman. Instead they act rudely or aggressively. This happens more often when they're with their male friend(s). I assume the author means that these men are afraid of being rejected in front of their friends as it would be embarrassing to them.Unfortunately for men though, for the majority of us, approaching a pretty woman is one of the most stressful situations that we can find ourselves in - the fear of rejection can become so overwhelming that it can translate into strange verbal outbursts or downright weird behaviour.