Is it necessary to know a lot of advance math to become a good junior high/high school teacher? By "advance math" I refer to Real Analysis, Abstract Algebra and Linear Algebra (to the level of Axler). I received mainly Bs in these courses with the exception of the intro-level Linear Algebra. Since I intend to be a teacher, is it necessary to have mastered these subjects at the elementary level? 
 A: For high school, of course it must be clear that you have to know elementary algebra, probability and statistics, and calculus very well.  Some high schools also have courses in linear algebra.
It will help you to teach these subjects if you are able to explain their underlying motivation, however, and you build your ability to do this by studying their advanced counterparts.  It's difficult to make integrals interesting when you've never done any PDE, never done any analysis in $\mathbb{R}^n$.  Most importantly, studying advanced material teaches you how to think like a mathematician, which is exactly what high school students need (but rarely get the chance) to see.
You can teach calculus classes out of a textbook, but you won't be a good teacher.  Take pride in your work - be engaging and inspiring, not another lame high school teacher that bores kids to death and turns them off from math for life.  Take advanced coursework now, while you're still in school.
A: 
"Is it necessary to know a lot of advanced math to become a good junior high/high school teacher?"

It is neither necessary nor sufficient.
One of the best math teachers I've ever had probably doesn't remember much (if any) advanced math beyond linear algebra.  I don't know how he performed as a math student himself, but I'm not sure it really matters.  He is almost universally loved by his students, is very involved in the math team, and consistently challenges students to go beyond the routine algorithms and formulas.
On the flip side, I've also had teachers who certainly knew advanced math very well, but were unable to communicate effectively even the basics to students.
Of course, as Qiaochu points out, having an understanding of advanced math certainly couldn't hurt.  For example, it might help provide a deeper context for some of the math you're teaching.
Now I'm not a teacher myself yet, so maybe take what I'm saying with a grain of salt.  But as far as I can tell, good teaching is ultimately about dedication, effective communication, a responsiveness to student needs, and an interest in mathematics that goes beyond the textbook.  I think these are the important things.
