'I'm sorry, I can't discuss that, because (friend's name) told me in confidence and it's a private matter'.
fine, but by saying that, you already tell half the story anyway! As I said before, I would not go into all the gory details, and in most cases husband would not care a bit anyway, but I don't believe I am betraying anyone by just mentioning someone has health problems, is being cheated on, is on dodgy grounds at work or whatever drama is happening. I am talking to my husband, we keep things between us, I am not talking about chatting with random people.
Last time I went to hospital I only told a couple of very closed friends and did ask them to keep it quiet. It never even occur to me they had to keep it from their partner! If nothing else, as I believe they care for me, they are entitled to get comfort from them if they need. I can't decide if it's selfish or childish to burden someone with bad news but decide they have to keep it hidden from their partner.
One of my friend keeps certain work things from her husband because he's a journalist. She trusts him, but would put him in an awkward position, it's sometimes easier for him if he doesn't know. That's their agreement anyway.