To put it bluntly: in-game actions should have in-game consequences.

The origin of the in-game actions (metagaming or roleplaying) is irrelevant.

If the priest drinks like a fish, that is how the character acts. The player's motivation for having the priest be a drunkard doesn't matter.

What matters is how the party and GM react. Others have already pointed out that social stigmas, excommunication, exile, and execution are possible punishments for in-game actions. Being denied the support your character normally relies upon is an in-game punishment for in-game actions.

Having former allies actively working against you because you betrayed their principles in public is another serious disadvantage. Now, instead of fighting the necromancer with a dozen priests backing you up, you might have to fight your way through a dozen priests before you get to the necromancer. That's a mechanical disadvantage for roleplaying if there ever was one.