expresses the cynical view that
people who lack practical ability become teachers instead; the saying is a disparaging stereotype, not a fair assessment of teaching or teachers.
Imagine a case where if you can do a job, you do it.; then “He who can, does; he who cannot, teaches” fits well.