Your sin is like a prostitute. You are speaking against your lover in public but embracing her in the bedroom. She is not particular about being run down in public if she can have your full attention in private. You may repent primarily for temporal gains rather than the glory of God. There are gains for the repenter, but the final motivation for repenting cannot be selfish.
Self is a dead, stinking carcass to be discarded.
We are to repent because God is worthy and is our respected authority, even if we gain nothing. Indeed, our repenting may appear to lose us more than our sin had gained. And this is a test of true repentance. You may repent of lesser sins for the purpose of avoiding the greater sins. We try to salve our nagging conscience by some minor exercise of repentance, which is really no repentance at all.