Having now heard the feedback for the Top 5 teachers, I wanted to drop in a couple of additional mentions...
5. Jack Black as Dewey Finn in School of Rock - terrific fun. And even more funny that it got turned into a UK reality TV series, where Gene Simmons (yes, from Kiss!) goes into a top UK private school and tries to turn some classically-trained posh kids into a rock band...
4. Tom Cruise as Frank Mackey in Magnolia. OK, I know I'm pushing this one, but he did have a class and he was trying to teach something...!? Just a great, fun performance where he knows he's playing against type and chews up the scenery.
3. Alan Rickman as Severus Snape in the Harry Potter films. I was surprised there wasn't a mention - they're not the greatest films ever, but there are now 5 of them, all set in a school! Snape is great - perhaps better in the books as he's generally given more presence and nuances beyond his outward nastiness. But Rickman is fabulous as the teacher whose classroom just oozes menace and you dread every time his lesson comes up on your timetable.
2. Robin Williams as John Keating in Dead Poets' Society. For all the reasons you discussed - this made me want to stand on my chair in the cinema when I saw this (aged 20!).
1. Matthew Broderick as Jim McAllister in Election. I SERIOUSLY cannot believe you omitted him. It was the first name that came to mind when I saw the Top 5 subject. This was a fantastic, offbeat film with a very dark centre. Jim McAllister is pretty reprehensible throughout, but faced with Reese Witherspoon's demonic Tracey Flick, he tries to do the decent thing. I think I was alone amongst my friends in loving this film when it first came out, and I still love it now.
Honourable mentions...
Mr Ray in Finding Nemo - how cool would it be to be carried around your school and field trips by your teacher?!
John Cleese's Centurion in Life of Brian. OK, so he's not strictly speaking a teacher, but that scene never fails to make me fall apart in laughter, tinged with some distant memories of MY LATIN TEACHER, Mr Willson, on whom I swear the character was based..,