It is possible that some people teach for the enjoyment and gratification of it. Some of my lecturers are excellent programmers.
Good programming skills are not necessary to teach CS, but that does not imply that teaching CS is a sufficient condition for having bad programming skills. (Propositional Logic 101, taught by someone who may or may not be good at programming).