You may not necessarily need to do research to be a good teacher - but depending on where you go, getting a "permanent" position may have its own requirements of research. In the US at least tenure is usually tied to some level of research involvement, which ranges from "you need to be a top researcher" to "you need to get your name on a few minor things, but it's possibly less than you did for your masters", all the way to no research requirement (more typical in small liberal arts places, community/junior/tech colleges, etc). But lets say you got a position and you just want to be the best teacher possible.
To be the best teacher possible, the use of research may heavily depend on what exactly you teach. If you are teaching the first two years of typical math - college-level algebra, geometry, calculus, probability - as far as I'm aware that material has not, and likely will not, be changing from year to year and new research findings in those fields won't much change low level courses. Some of my favorite teachers in this area actually have told me they don't like research and that's a large part of why they sought out the opportunity to teach such classes, and I can't really imagine how having done research specifically enhanced their ability. Low level math classes are usually just so incredibly far from research that I can't see how experience in research would be indispensable.
On the other hand if you are teaching applied math in areas like data analysis, machine learning, statistics, etc - keeping up to date on the newest approaches and techniques would be extremely important to ensure your students are getting the education they'll need for their chosen field. Similarly if you are teaching just about any other high-level class, much of the material can be inspired or based on insights from research.
Finally, if your students might possibly want to seek involvement or even a career in research, not being actively involved in research can restrict your ability to help them down that path. If you will be asked or expected to advise independent study, or teach classes specific to things like research methods in your field, you may find your effectiveness impaired by your lack of experience and ongoing involvement in research.
If you don't fit into any of these special-cases, and the reality on-the-ground in your region/country allows you to be a teacher without research, then I don't think research will be strictly necessary for you. But for many people in many different regions, research is often a requirement to some extent - from a minor requirement to an absolute necessity.