What are the best programs for editing midi files?
I'll admit I'm biased because I've been working with it for years now, but Apple's Logic has one of the best MIDI editing interfaces going. If the Pro version is a little too much for you to stomach there's an "Express" version that's pared down when it comes to plugins and samples, but has the same excellent MIDI editor.

On the cheap-but-effective side you've got Reaper which will run on OS X and includes MIDI editing facilities. You can try it out for free and it's $40 (at the time of writing) to buy it if you like it. Hard to beat that deal.

And then in between these two running the gamut of price and features you've got a whole slew of other options: Cubase, Sonar, Abelton, etc. Each of them offering slightly (or not so slightly) different interfaces and feature sets.