But no rule may punish a player for failing to adhere to such a code.
Well but if a player chooses to play a Cleric of the god of Justice, and then pretends to murder, steal, lie, deceive, fraud etc. and keep the class' benefits and powers at the same time, doesn't that sound lame to you?
If the player wants tactical options and crunchy powers, and they are available only to Clerics of the god of Justice, but he's not interested in the character concept, then it should be up to the DM to find a way to give them those powers without forcing the concept, e.g. design an alternative class or deity or find one that suits from an existing book.
What cannot be fixed, is a player saying he wants the concept but then refusing to roleplay the same concept. That just means the player sucks at playing the game, and most likely is detrimental to other people's fun.
In some way, penalties for failing to adhere to restrictions should never apply, because the players should be never willing to roleplay badly. Player #1 could be purposefully roleplaying a paladin that's falling to the dark side, and it's totally legitimate! Something should then happen to such paladin, but it doesn't actually have to make the PC
mechanically inferior to the others. Player #2 could be just a mediocre player who makes plenty of mistakes, but is it worth punishing him? Mistakes usually means more chance of death and less fun for you in general, I think the punishment is already there, I'm not sure I want to punish him more than I would if he were badly playing a fighter or rogue. Player #3 could be plain lame and pretending to behave contrary to the spirit of the rules, deal with him the traditional way: kill him and take his stuff. Those who behave like an ogre's arse deserve to be treated like an ogre's arse.
With these in mind, the game doesn't really need to specify what happens
mechanically to a paladin that's fallen. It might give off some examples, but these should be applied in practice really only to Player #1 who
wants to roleplay this kind of character story. So then comes the problem: is it fair to punish this actually pretty good & brave player, by making his PC worse than the others? I am not so sure of that...
This is actually why previous editions had options for fallen paladins to become antipaladins, presumably just as powerful. But it is only one possible outcome for the story, and it's the most dramatic with serious repercussions to other characters: how can the same PCs first work with a paladin, then keep working with a blackguard?! Maybe some totally neutral party can, but most parties have at least some good PC, while evil parties who not have started with him. There are other possible outcomes for a falling paladin, at least (1) a fallen paladin who's simply reduced to being not paladin enough but remains a good PC, and (2) a fallen paladin who will succeed to get back to his path. Both these are must easier for the story and the rest of the party, but how can the game support these well if the player has to take penalties, not for having played badly but for having played well!
I don't know how to solve this... Maybe it has to be up to each gaming group. I wouldn't personally like to let the player convert paladin levels into fighter levels on the fly, with many fighter abilities "popping up" out of nowhere. At least, if multiclassing works decently, I would prefer that the "penalty" simply means he cannot advance in the Paladin class further but has to take levels in something else, assuming that this results in a balanced PC; however this would mean to retain his supernatural paladin powers and spells, which has an implication on how this stuff works in the fantasy world (basically, that whoever granted those powers either cannot take them away or chooses not to). A more complicated way would be to gradually "phase out" at least the most paladin-only magical abilities, and slowly replace them with something else, taking advantage of retraining rules when possible.