In this sentence, "teaching is sterile" and "teaching is education" respectively describe two educational methods. The former's "teaching" focuses on imparting knowledge, while "teaching" emphasizes the importance of cultivating morality and personality. The latter's "teaching by education" regards education as a process of all-round development, including not only the imparting of knowledge, but also the cultivation of students' moral quality, emotion and social ability.
Generally speaking, this sentence emphasizes the duality of education, including both the skills of methods and the concepts and principles of education, aiming at cultivating all-round talents.