There is no "must" as you say, but in Islam it is an aspect of encouraging patience, advice and suggestion. This is because if a man or a woman is not patient and retaliates or divorces his wife, the center of that family will fall apart and we have narrations that divorce is the most hated thing in Islam. And marriage and family formation is the most popular and valuable building in Islam. That is why many men and women are encouraged to be patient in the face of their spouse's immorality. So that this family center does not fall apart.
In some narrations, it is stated that the torment of the grave has been removed from three groups of women. Some of them are those who are patient with their husbands' immorality. At the end of this hadith, it is stated that God gives the reward of a thousand martyrs to each of these three groups of women for their patience, and for each of them, the reward of one year of worship is written in their deeds.
It is mentioned in another hadith of the Holy Prophet (PBUH). Every man who shows patience and forbearance over his wife's immorality, God will reward the man who gave him to David - or Ayub (peace be upon him) for enduring disasters. And if a woman bears the immorality of her husband and is patient, God will provide her with the reward that she has given to Mr. Asia, one of the top four women in Paradise.
On the other hand, there are many hadiths that forbid men from committing immorality with their wives and family members and frighten them of immoral punishment. As far as it is stated in the hadith: Any woman or man who annoys his wife with his immorality, God does not accept their prayers and other acts of worship and good deeds, even if he has always been in worship.