We can condemn the behavior and still have compassion. Think about it.
It is not compassion to “spare the rod”.
Correction is what is needed in order to bring the sinner to repentance. The only way that is accomplished is to show the pattern to their choices and the consequences of those choices. Once the person sees the error of their ways, they can then be show the alternative choice, and in love, accept them back when they have changed their thinking and behaviour.
Without the light, there is only darkness.