I don't think perfect adherence should be expected. If there's a code of conduct and someone runs afoul of it, just give them a gentle poke and point them to what they ran afoul of. If they're cool with the code of conduct, great. They fix their behavior and everyone's happy. If they don't like the code of conduct, then they're welcome to join a community with a code of conduct that better matches their outlook. If they continue to stick around anyway and violate the code of conduct after being informed what they're doing wrong, they get the boot.
Where this gets stickier is when you build monolithic communities like Stack Overflow where "the boot" is actually seriously punishing. I only ever moderated little game forums where the consequences of a ban were far less severe. Which is why I tend to think it's better to have small distributed self-managing communities rather than monolithic communities. Makes it easier for diverse outlooks to live-and-let-live without requiring minorities to conform to the majority.