Why should a teacher know how to teach different classes?
Very few teachers will end up teaching only a single class over all of their professional lives. There are several career reasons for having the ability to teach several different classes.
The first reason is that it gives you more in the way of geographical and school choice. For example, if you are trained to teach only, say, high school American History, you must take whatever jobs are on offer in that field, even if they are a long commute or in a school district you don't like, but if you have a wider range of skills, there is a better chance you will be able to find a job in the schools where you wish to teach.
At the university level, very few departments would consider hiring someone on a full-time basis who could only teach a very limited range of courses. Normally, in order to offer a course, a department needs at least two or three full-time faculty who can teach it, meaning that hiring prioritizes people who can cover a range of required courses.
A teacher must know how to teach multiple subjects so they can have a more of a well rounded teaching approach that uses knowledge from every avenue. If a teacher knows the curriculum from each subject then their lessons can reflect knowledge from many subjects at one time, such as geography and language. It is a challenge for teachers every year to cover all the curriculum topics. If they know many subjects, then lessons can encompass ideas from different areas and cover more curriculum at once. This can leave more time for extra help, challenging topics, or class discussions.
Also, if the teacher knows the main ideas that the students are learning, they can relate one topic to another. For instance, if a student is having trouble understanding a topic, it could be related to another subject that has already been learned. If the student knows the previous knowledge it can be used to clarify the current issue. If the teacher only taught one subject, they would not be able to relate those topics to assist the student.