We' have the Great Plague of 1665 in London to thank for the expression "6 feet under." This tragic recurrence of the Bubonic Plague (which first decimated Europe in the 14th century) was the impetus for the law requiring dead bodies to be buried at least 6 feet below ground.
The comprehensive cemetery site, City of the Silent, addresses the matter on its page of frequently asked questions. English law once required a burial depth of 6 feet to ensure the corpse didn't spread the plague to the living. Of course, this measure was ineffective as fleas infected with the plague probably spread the disease. Also, few diseases are contracted from contact with dead bodies.
The same site gives a rather gruesome description of early cemeteries as being "littered with bones and bits of charnel." Furthermore, shallow graves allowed scavengers (presumably both human and animal) to easily dig up the remains -- which makes a 6-foot-deep burial seem like a decent idea. Furthermore, it's a tradition to speak of 'six feet under, but it is no longer the law, with many places in the U.S. requiring lesser amounts.