Are we ever permitted to rebuke them?
Why, yes. Rebuking though is not the same as not forgiving. A lot of what the prophets did was rebuke those they addressed. Some, like Jeremiah, did so through their tears. Christ rebuked plenty of folks. Rebuking is, or at least can be, a way to call people to repentance by telling them they need to repent.
But when dealing with people who display the fruit of depravity, fruit associated with having been turned over to depraved minds, rebuking them can also serve the purpose about helping to warn others of their spiritual condition. Christ did this when He rebuked pharisees and scribes and in that context warned others about their saying and not doing. We should forgive such persons when they do us wrong, it is true, but that doesn’t translate into continued fellowship with them as if they were Christians.
I believe Paul was clear that when repentance happens, though someone who has the proverbial smell of fire clinging to them, there there should be fellowship. Even if a fellowship filled with concern for what they may yet be bringing with them from their previous life romping in some burning cesspool of sin.
A big problem, not just with our society but all of them (mileage varies), comes when believers compromise and people are let into fellowship though openly unrepentant. I occasionally paraphrase a classic hymn to speak about these, writing: “Just as I am, I’m changing not. How dare you say my soul has spots! I’m okay with me, and that’s enough. Lamb of God I’ll come, but only as I am.’
Rather than compromise we should call people to their knees, not to their proverbial Lazy-Boy recliners.
As for the laws of a nation, at least these days, they do not try to rebuke folks for their better that way ... probably should since secularism easily enables the worst in men ... but they can still be within the Lords will, even for the death penalty.