Teaching and research are the two main jobs of mathematicians in academia. Research is often valued above teaching, even though I've met a lot of miserable researchers and happy teachers. Both are important: research for its own sake is as valuable as writing symphonies or studying physics, and teaching is good for both future mathematicians and people who will simply use mathematics in their lives in the world. No arguments here about the value of one over the other.
What I'm really interested in here is a strange phenomenon that I see fairly regularly: students and postdocs (and maybe professors?) who seem to feel that since their research is going badly they're meant to be teachers, or whose students hate them and so feel they're meant to be researchers. Utterly mysterious. Why does this feeling have any purchase among graduate students and postdocs? It would make sense to me to feel that you're meant to do the thing you're good at, but to feel that you're meant to do the thing you currently suck less at does not compute. I've seen it at least twice this year, though -- two folks who were intending to do more education-focused math realizing that they're not good teachers and thus deciding they ought to do research. Fine. I don't think it will last long, as it is easier to persist as a mediocre teacher than a mediocre researcher due simply to economics right now.
And why is industry left out of the equation? Maybe you are not good in front of a lecture, and you realize that the life of a researcher is not for you, but you are good at solving problems and doing math. Maybe you're even great at programming or organizing conferences or writing. Look at your strengths, people! Pursue them!
Professors, quit telling the students that aren't so great at research that they are good teachers unless you know they actually are. They are deluded, and upset when they discover the delusion. Even worse is when they don't discover it.
Having now been in the liberal arts world a while, it's not easier to persist as a mediocre teacher.