Masturbation is somewhat like “cheating” on your partner. This can have an effect on the relationship. This article from Psychology today:
… At the same time, the urge to have sex with novel mates (Coolidge Effect) often erodes our pair bonds. The tension between these programs obviously shows up in different cultures in different ways. On average, it may push us toward serial monogamy…with some fooling around on the side. All things being equal, we bond long enough to fall in love with our children, who benefit from having two caregivers. Yet we also tend to increase the genetic variety of our offspring by changing mates.
Programs do not guarantee that a mammal will behave in a certain way, or even that every individual within a species will experience the same inclinations. (There are always outliers, that is, exceptions, who vary from the norm.) Nevertheless, programs can produce very powerful, predictable urges and inner conflicts in most of us. They can drive our behavior without our conscious awareness and cause us to rationalize actions we know we will later regret.