Sure, it's good to get along with your teacher because it makes that time you spend in the classroom more pleasant. And yes, it's good to get along with your teacher because, in general, it's smart to learn how to relate to the different types of people you'll meet throughout your life.
But really, there's one super-important reason why you should get along with your teacher. Kids who get along with their teachers not only learn more, but they're more comfortable asking questions and getting extra help. This makes it easier to understand new material and do your best on tests.
When you have this kind of relationship with a teacher, he or she can be someone to turn to with problems, such as problems with learning or school issues, such as bullying. As a kid in elementary or middle school, you're at a wonderful stage in your life. You're like a sponge, able to soak up lots of new and exciting information. On top of that, you're able to think about all this information in new ways.
Your teacher knows that, and in most cases, is thrilled to be the person who's giving you all that material and helping you put it together. Remember, teachers are people, too, and they feel great if you're open to what they're teaching you. That's why they wanted to be teachers in the first place — to teach!