In Bleak House, law is a hopelessly tangled mess of unsolvable, endless cases, and the power of the police is new enough to be used sometimes to further private interests or for other morally ambiguous purposes. So the only way to ensure moral coherence is to devise and stick to some kind of code of honor. Many characters have such declared principles, some of which make sense and some of which don't, but none of which are meant to be taken lightly or ignored.
In an ironic twist, the more options a character has (through wealth, power, education, or career prospects), the more likely he is to stick to his principles. Those who are less fortunate and do not have the luxury of choice paradoxically end up with far more freedom of action.
Although principles would seem to ensure a strict code of behavior, in practice most of the people who have them are able to twist them to suit their own ends.