They have opened up to you because they trust you to keep what you’ve been told confidential. They shared a personal part of themselves that they don’t want others to know (that’s the definition of ‘secret’). It is their information and they should be the only one sharing it.
Trust is easy to lose and hard to get back. You don’t want to break that trust.
If what they disclose is big and can impact both of you (health situations, job loss, addictions), talk about it together. Don’t go blabbing or complaining to others just to vent or get their opinions.
If the information is too big for you to hold alone, you can ask for their permission to share it with someone. Ask with whom they feel comfortable with you sharing. There may be some people (a professional or mashpia) that they are OK with, and not others (like your family or friends). “This is huge for me to hold and process alone. I need to talk this out with someone. Who are you comfortable for me to talk about this with?”
There are some secrets in a marriage that you should never keep. If your spouse is hurting you or the children, reach out for professional support. What you share with a therapist will always be held in utmost confidentiality.