I think Bethalize's situation is relevant in that if the wife stays silent as her friend complains about DH's behavior, it could lead friend to think that the wife completely agrees with what her husband did/said.
I don't know that I would apologize "on behalf of" my spouse--that makes me think of, "Bob said to tell you he was sorry" or "Bob's really sorry for what he said."
But if my friend was complaining of an insult from a third party that I didn't even know, I could easily say, "I'm so sorry they said that to you! That's awful!" So I think I could reply in that vein if she were talking about my spouse. It would probably be more like, "What? That's a weird thing for him to say. I don't know what he meant by that," in a disapproving tone. Or if she was really upset, something like, "I'm so sorry you were hurt by his comment! I didn't hear it and I really don't know what he meant by it." I guess I wouldn't take the extra step of promising to do something about it; but I would definitely ask my DH about it later and see what the deal was, and decide how I wanted to proceed. Depending on the situation I might strongly suggest he apologize directly to friend, or that they not socialize together for a while, or just advise him that she doesn't find that particular topic funny and now that he knows, it would be mean to bring it up again with her. And I wouldn't want to be married to someone who was deliberately mean.