It's conceivable that good looks might correlate with qualities that actually have something to do with good teaching, such as confidence. But researchers exploring the role of teachers' looks on student evaluations largely ruled out that explanation:

Using data from an Italian University we relate student evaluations of teaching quality to physical attractiveness of instructors, controlling for a number of teachers' and courses' characteristics. We first show that the beauty of teachers strongly affects teaching evaluations. To investigate whether the impact is due to productivity or discrimination, that is, if the better evaluations obtained by good-looking instructors are determined by their possess of greater abilities or by Becker-type customer discrimination, we propose a simple theoretical framework and build a measure of teachers' abilities that is used as control in the empirical model explaining teaching evaluations. We show that beauty affects teaching evaluations even controlling for ability, suggesting that customer discrimination is the key factor explaining the role of beauty.

"Engaging in Becker-type customer discrimination," incidentally, is a nice euphemism for ogling your literature professor.

Source: "The Good, the Bad, and the Ugly: Teaching Evaluations, Beauty and Abilities," Michela Ponzo and Vincenzo Scoppa, Università della Calabria, Dipartimento di Economia e Statistica Working Paper (March) (via Ideas)