4017 IC block diagram
The FFs are not counting in binary, they're a Johnson (twisted ring) counter. This has the advantage that any given state can be decoded using a 2-input gate, which is exactly why they did it this way. Adding one extra FF is simpler than creating ten 4-input gates. And also, the outputs are guaranteed to be glitch-free, since only one FF changes state at a time. The ten output gates detect which FF is about to change state, by comparing input to output.