It seems you have been aware that she has an issue with your friendship with her DH for some time. You said they argue about you when you're asleep.
Why has it taken her final very direct message for you to step back?
Most people who received messages from their friend's spouse of the nature you have previously received would have realised you are an issue in their marriage, even if it is unintentional and stepped away a long time ago.
If you felt your DH was putting another woman before you and your family, I'm sure you would have an issue with it too.
I'm not sure if it's naivety, your own mental health or inability to see her POV, but you not pulling away from the drama of being on the receiving end of these messages before now is quite concerning.
If my DH was messaging another woman as a friend and her DH contacted him and expressed not liking it, then I would tell him to stop, as he was clearly perceived as a problem to the husband.
I don't think your behaviour to date (apart from now backing off), with the knowledge of how she feels has been helpful or respectful to their marriage.
It's very sad that the wife has had to resort to threatening to leave and take the child away, for you to see how serious she is.
No doubt she has made her feelings to him clear, but he didn't listen...so her last desperate resort/attempt to save her marriage was messaging who she sees as the OW.
You have heaps of empathy for him and none for her...while you believe everything he says.
Hopefully, they can get to a better place and if they split without you in the picture...then perhaps it's the best thing for everyone.