Lies and secrets damage the fabric of trust and cooperation in marriage. This is true even before the secret is discovered (and they are almost always discovered). I will spend some time here describing my thoughts on why secrets damage marriages and why lies make them even worse.
It turns out that when humans live together in close proximity, they communicate on many different levels with only one of those being verbal communication. Just because you don't talk about something doesn't mean it isn't being communicated. Moods are communicated, stress levels, and all sorts of other non-verbal cues can lead to intuition. Intuition is how our mind makes decisions or draws conclusions outside of our conscious awareness. So, you make think a secret is safe if it is not verbalized, but I believe otherwise.
One example of this is the well known phenomenon that when groups of women live together, their menstrual cycles can synchronize. This process occurs automatically and unconsciously without any effort by the woman. So the simple factor of cohabitation produces an actual, predictable physical change.
From this example, we pull the rationale for my argument for why secrets and their resulting lies are so dangerous to relationships. When two people live in close proximity, both emotionally and physically, they become a social system. Social systems are ripe for change and adjustment based on the physical and emotional characteristics of their members, like the group of women and their periods. When a partner in a marriage is holding on to a secret, small or large, noticeable shifts to the system occur. Some partners will experience this as a sense of "offness" and ask, "Is everything ok?". At its worst, the marriage can subjectively "feel" different and uncomfortable. This new atmosphere of difference can trigger intuitive thoughts, anxiety responses, and adjust the behavior of both partners even if they are unaware of why this is happening.
In summary, when two people are in an intimate system such as marriage and one party is holding on to a major secret, especially one that includes lying, a shift will automatically begin in the system. This shift will be sensed by both parties consciously or unconsciously and they will move to counteract that shift either consciously or unconsciously. It is those MOVES that begin to erode and damage the stable marital system. When the marriage has been unhappy, it is those very MOVES that the betraying party is trying to create in the first place. The system or marriage will no longer be what it was before and the drama of those shifts will be apparent and uncomfortable. The goals of Couples Counseling are to either find those moves before the secrets begin or to repair the damage in trust and then begin to implement the MOVEMENT that is needed to create a more satisfying marriage.
With all that said, there are some relationships that are too fused or too enmeshed and need a bit of privacy. Privacy is not to be confused with secrets. Privacy is a healthy form of independence and separateness that can become squeezed or suffocated in certain types of relationships. The difference between a secret and a private matter is that a private matter would not be dangerous to discuss at some point with your partner in the way that a secret would be. A test I like to use is: If you think you would be nervous to tell your individual therapist the fact, it is probably a secret.
The thoughts and beliefs that people use to rationalize keeping a secret usually become frighteningly true in the end anyway. "I keep it secret because I don't want to hurt them." "I keep it a secret because it isn't the right time for them to know." What usually happens is that the partner finds out somehow (see Dostoyevski's Crime and Punishment, ie guilty parties are inexplicably drawn to revealing their crimes), the partner usually gets more hurt because of the lies, and they usually find out.