The distance between the outer surfaces of the rear dropouts (called the Over Locknut Distance or OLD) is different. For road bikes the std is 130mm, for MTBs it is 135mm. Most touring bikes and hybrids and some cyclo-cross bikes use the MTB std.
Some frames are made with an OLD of 132.5 and can be used with either size.
MTB hubs are all 135mm. Most road hubs are 130, but you do get the occasional one for 135 (like my Campagnolo Mirage). The difference is in the length of the axle and the spacer rings.
The advantage of a wider OLD is that you can use a hub with wider flangers and you can build a wheel with less dish.
07 Fisher Paragon, 00' Lemond Buenos Aries, Specialized Langster, Schwinn World Sport SS townie, 99 SS-Works single speed conversion, early 90s Raleigh roadie rain bike, 07 Fisher Rig, Trek 520, and a home-modified chopper
As Michael said, it's for less dish and a stronger wheel on mtbs. A road hub will probably be lighter, but not as strong and a mtn hub will probably be heavier, but stronger. Just think about your body size, riding style, and intended use in deciding which type hub is right for you.