In countries without state welfare, marriage is an economic construct to secure the funding of raising children. In the past it was also used to secure the funding of the potential mother.
Marriage did already change a lot. But in the countries with shitty state support for single parents and their children, it still serves its purpose. It does not prevent cheating, though - and probably never did.
You are right that the judgement is a bit stupid.
A quarter of all men cheat. A fifth of all women cheat. Cheating is somewhat common. Maybe, it's time to accept the fact that human sexuality isn't really that easy to confine. Normalizing porn as venting mechanism for unfulfilled desires might help men and women stay exclusive.