It is an unfortunate reality that there are people in this world who blurt things out. When they have a partner, they may be told things about their secret fantasies, or their partner might tell them secrets about their family. When a person is unable to keep a secret, they may feel their partner is betraying them when they find out they are the only one who does not know something. They need to realize their own behaviour is what makes them untrustworthy.
It can be devastating for a family member to realize a trusted secret with a sibling has been told to a spouse. What may happen is that the person unable to keep a secret may not be trying to hurt the sibling. Their letting the truth out may be an effort to become closer to that family member by revealing what they know. Their motivation does not matter because their spouse and the sibling of their spouse are both hurt by their action.
It can be painful to learn that a partner should never be trusted with an important secret. Even if they are told not say anything, it may have the opposite effect. Blurting out private information is never a good idea, and it can ruin the relationship between the pair. It may feel like a betrayal to avoid sharing any secrets, but it is also a protection against having everyone know them.
There may never be a cure that will keep this type of person from speaking about subjects that are best left alone. If there was a pill they could take, then many spouses might be willing to pay any price for it. Until that happens, keeping their secrets hidden away from the person they may trust with their left could be for the best to retain their current relationship.