Short Answer: no, it doesn’t have to be.
The Long Answer is that every relationship is different and the motivation is what should be the determining factor rather than the action itself. Even if the relationship doesn’t end when you or your partner has been unfaithful, a severe breach of trust has been committed. Rebuilding that trust is extremely difficult and isn’t always possible. No one is obligated to continue the relationship after such a detrimental blow but there are some things to be considered before making the decision.
People don’t always cheat for the thrill or just because they can. Oftentimes a person’s unfaithfulness is rooted in a need they have that isn’t being met in their committed relationship. This does not mean either partner is inadequate or lacking. Our sexual needs can be extremely difficult and outright humiliating to admit, much less talk about with our significant other. Honest communication in a relationship isn’t easy to begin with. The idea of communicating a need that is considered deviant or taboo can be downright paralyzing. This paralyzing discomfort will often lead to one or both partners straying or going unfulfilled, both of which can end any relationship.
If your situation is one where you or your partner cheated because needs were not being fulfilled and you’re both willing to attempt rebuilding the trust that was lost, you should give it a shot. Take this as an opportunity to learn how to communicate with each other about those needs and other sensitive topics. Be open-minded and understanding with each other. Try new things. You may be pleasantly surprised and find that you enjoy things with your partner that you never even thought of or dismissed previously. This openness and willingness to experiment with new things can be incredibly enriching and the improvement in your communication will change your relationship for the better.
If you or your partner are not willing or able to fulfill each other’s needs you may want to consider opening your relationship before you consider ending it. If opening your relationship isn’t a possibility and needs cannot be met, you should part ways so that both of you are free to find fulfillment. And that’s ok. Even good relationships end and no one should stay if they aren’t being fulfilled.