My FWH watched a lot of porn. It changed the way he saw women and he began to objectify them, which led him to fishing, which let him into an affair. I do not know if your husband is doing this, but online porn can kick you out of reality, especially if it is compulsive. Again, not sure if this is relevant, but porn was a big part of why my husband became inappropriate around women.
OR
Your husband is fishing to see if your friend will tell and if she will respond in kind because he is simply a selfish, entitled ass with no integrity. Does he act in a self-centered, entitled way in other areas of life?
If this was a verbal comment when she was in the same space, I would say that maybe he is super immature and thinks he is funny, but the fact that he sent her a message shows that he is being secretive, which makes the red flag even redder.
In any case, he needs to know 1. it is completely unacceptable and 2 that it creeps your friend out and 3. that it hurts you and 4. that he needs counseling around entitlement and boundaries and 5. that you get access to his phone/computer/social media since he is being inappropriate with other women while using it/them. This does not only affect him, it affects you. He has no right to impact your life a negative manner without your consent.
Your husband needs counseling with someone who understands infidelity and the cheater mindset. Interview counselors. If there is even a whiff of blame shifting, NOPE. Same with marriage counselors, if you go that route, although he will need counseling regardless.