Marriage is just part of the toolbox for mass cooperation. We need it to help maintain a sense of order at scale. Women are going to be inclined to have children and will make irrational decisions if they get too close to the biological clock hitting 12. Single men looking for flings - the closer women are to that time, the more cautious you should be. If they are not being straight and telling you they "need" to have kids - don't trust them at all.
On the other hand, it's straight up instinctual for most men to desire many women. They are biologically built to impregnate as much as possible. I won't go as far as saying they are not built to hang around for long and have affection and want to care for their children, but most men do naturally feel attraction to several women and the urge to bang them randomly.
So men and women are often unhappy due to a self-imposed situation. I think you can be happier if you simply understand the biology and appreciate it. That allows you to more easily cope with your underlying urges and instincts.
IMO, infidelity should be socially accepted. Having a partner at home is key to raising children well. But we are raised to think that having more than one lover is immoral and bad (in some places it's even illegal). We could all be much happier if we got more love and attention instead of being suppressed. Most women tend to experience a much greater loss of desire with age as compared to men, but if they could feel comforted by the common union (them and children being provided for) and were not judged by society, I don't think they'd feel threatened by affairs. Same for men with respect to fear of losing custody of their children. Sadly, we operate more on fear of what we can lose than actual positive incentives.