You need to sack people sometimes
I have worked in development environments where managers are too scared to sack, they either just torture developers by punishing them for a job they evidently can't do by trying to put perverse restrictions on development teams or let them wreak havoc on the development processes.
Talented developers get disillusioned by the production of bad code or the unequal skill-basis. Other developers get away with poor code when they are often forced into a maintenance nightmare. Faced with the prospect of a maintenance nightmare (or in all likelihood, an increasing maintenance nightmare), they then resign.
Alternatively, the restrictive work conditions imposed to compensate for bad developers disillusion talented developers. ...