OP I totally agree with PoorYorick.
Can I add a change? I said before bring it up incidentally but I now feel that would be too obvious and direct is best.
Maybe, invite her out somewhere, go for a walk, whatever.
Maybe, say "I got the feeling your comments about my dh and his sperm being wasted might be more of a request than a joke, I could be wrong but I decided to talk to him about how he feels about sperm donation."
(I would not say you said it in relation to your friend.)
"DH said he won't donate sperm, not to strangers or friends, it's not something he is ever going to do." (Optional..." And I support him in that as I would feel very uncomfortable if he did.")
"I know you didn't exactly askr/us but I wanted to discuss it just on case you were wondering about it."
Personally, I would not go into reasons or engage. If she acts defensive "I never asked...."
Just be reassuring "I know, it's fine, you brought up the topic and I wanted to hear my dh's views."
Any guilt tripping just put on your sympathetic face. Maybe say "Fertility issues must be so hard. What is your plan?" Etc.
Don't engage in any what ifs relating to your dh - eg "Do you think if he knew it was for me? "Etc.
Polite, broken record.
I might end by saying "I can see this is so hard. I'm here is you need someone to talk to. But not about my dh. I feel that I want mine and eh's relationship to be private, and I totally respect if you and dw's relationship is private too. But I care for you as a dear friend (whatever is true) and just wanted to try and be a support."
Only say what you are happy to say, when that runs out, stay silent or repeat anything relevant at a suitable point.
Do not go 'off piste'!
Practise saying in the mirror the "I don't feel comfortable discussing that."
Don't add alcohol to the conversation if you can help it!
All the best.