Why do some mathematics professors teach more/less courses than others?
Depending on the department, the rules can be very different, but here are some things that I have seen that can lead to teaching reduction from a theoretical teaching load that is the same across the board:


New faculty. Think of it as both a hiring bonus and a humanitarian "you are still settling in so we won't burden you too much." 
Super big shot. Some "research stars" can negotiate their way to a semi-permanently reduced teaching load; this is on the theory that their name recognition and the research grants that they can supposedly bring in will benefit the department greatly, and that in theory it is more cost effective to let them spend more time in research and less time teaching. 
Grant buy-out. Certain schools operate on a system where faculty can buy out of their teaching load by obtaining sufficiently large or prestigious research grants. 
Other service. Professors taking on administrative duties (chair, director of graduate/undergraduate studies, for example) get reduced teaching loads on the principle that they are serving the department in other capacities. 
Student mentoring. Some departments have established exchange rates of X graduating PhD students = 1 course, and Y undergraduate research students = 1 course to encourage participation in student research. 


Also, some people just love to teach. While professorial contracts usually state a minimum teaching load, I have not seen a case where a maximum teaching load is prescribed. 

In addition, at many departments the teaching is, by design, not equal across the board. Many universities hire special teaching faculty or adjunct professors. Sometimes these hires (temporary or not) do not have different sounding academic titles. Whereas research faculty typically have teaching loads of about 3 courses per year, the teaching faculty are contractually obliged to teach 6 to 8 per year (and many adjuncts are paid "per course" so the more they teach the closer to a living wage they earn). You cannot always tell from their titles in which category the professor is hired.