The key is repentance, which means turning away from sin and seeking forgiveness. A repentant sinner will always be forgiven and we are all sinners. Yet, if a person refuses to repent, or say they do, but wind up in the wrong bed again, and again, it cannot be tolerated.
One can think that their particular cherished sin can be kept secret, but I know from experience it cannot, it always comes out in time.
Sexual sin strikes at the very integrity of the Church, and undermines it as a moral institution. Dodgy appearances can do the same.
When my first wife was dying of cancer at age thirty five, I spent time with her best friend, because she had lost her husband, a friend of mine, at 26. I was trying to learn from her about the experience, the emotions, the practicalities, what I needed to prepare for. I never compromised my wedding vows in any way, and I couldn't tell my wife I was preparing for her death, she still had hope. A neighbor of the friend, not even a church member, reported us as having an affair, and all hell broke loose.
I should have been wiser.