I think your friend was completely out of order. She may have been drunk, which could be a mitigating factor, but that does not excuse it. Even if she was just trying to be supportive of you, she essentially ridiculed him in front of you and told him if he did not sort it out, you’d cheat on him (I am not saying you would, but that is what she implied). That is really not something that can be dismissed easily, it is absolutely not on. If my DH’s friend did that to me I would be humiliated, mortified and so upset. And furious too. I can totally understand your DH’s perspective. Your friend owes him an apology, at the very least, and I think she owes you one too. If you want to continue your friendship, I would not be sharing anything you want kept private, as it is clear she cannot be trusted to be discreet.
Contrary to some previous posters, I doubt it will improve the situation. He is now hurt, angry and feels humiliated- how that is going to improve a situation where there is a problem (presumably more/all from his side, from what OP has written) is beyond me. I cannot imagine many suggesting that if the genders were reversed- most would be saying that putting pressure on someone via ridicule and humiliation are the last thing that is going to improve a woman’s desire to have sex with her partner. I cannot think why anyone would think it is not equally horrible thing to do to a man. I know OP did not do this directly, but her friend has- in front of her. Did you express your disagreement at her behaviour in front of him, or sit quiet and apologise once she had gone? If the latter, you probably need to reassure him you don’t agree with her approach and she had been asking for advice/a listening ear, as opposed to sitting criticising and making fun of him to your friend all evening, which I imagine is a scenario that is running through his head.
OP also did not say her DH didn’t recognise there was an issue, and she also said she believed they could work through it. That is likely to be slightly impeded now, I’d have thought. I think the best thing for OP to do, having apologised already, is to give some reassurance that she does not think the way her friend implied and then to give him some time to calm down- then sit down and work through the bigger issues that are impacting your intimacy. You haven’t said whether it is a physical issue (e.g. ED, lack of libido) on your husband’s part, or an emotional/psychology one (or both) and whether he is the only one who is having trouble or if it is an issue for both of you, so it’s hard to know what might help. If he won’t address any of the problems, then by all mean
MN is a weird place- so many threads with women saying they would be furious if their DH/partner discussed any aspect of their sex life with a friend, yet for women it is absolutely fine, if not expected. I have no idea why it is ok for women but not for men. Not only that, few women would agree that being ridiculed- which is what OP’s friend did- is a reasonable way to treat a women, nor is it likely to make them want to be intimate with their partner. Yet, according to quite a few posters here, not only absolutely ok to do to this to a man, but will probably improve things as he will “take the hint” or “make him do something about it”- so may, in fact, be a positive thing to have done! Of course, if a man did the same thing to a woman, the same people would brand a man doing that as awful, misogynistic, lacking in respect for their partner and only being interested in sex. I imagine there’d be a few LTB too. I just don’t think it’s helpful advice, and likely to cause barriers in their relationship if it is not acknowledged that it was no way to have treated him.