He didn't drop out until they had effectively prevented any internal challengers by waiting until the primary was over the make the switch to his hand-picked successor.
If they had had an actual primary and not just ignored all the people protest voting 'uncommitted' in the joke one that they did have they wouldn't have botched it as bad as they did. That's on democratic leadership, not the voters.