In my opinion and experience, the process of teaching itself makes you a much better researcher. People can get bored doing research, epecially if it is primarily solo research. Plus, teaching forces you to learn a subject much more thoroughly than you would otherwise. And if you want to expand your research to a slightly different topic, teaching that topic can give you a lot of knowledge and confidence in that topic. I feel like teaching+research institutions do better research than pure research institutions.