There is a web site entirely devoted to the deadly sins. From this web site, quoting Sacred Origins of Profound Things by Charles Panati, the sins originated early in the Christian era when Greek monastic theologian Evagrius of Pontus drew up a list of eight, in order of increasing seriousness: gluttony, lust, avarice (greed), sadness (yes, sadness), anger (wrath), acedia (apathy), vainglory, and pride. Evagrius saw the escalating severity as representing increasing fixation with the self. In the late 6th century, Pope Gregory the Great reduced the list to seven items, combining vainglory into pride, acedia and sadness, and adding envy. Eventually sadness was dropped, possibly because they couldn't think of a nice grisly punishment for it in hell.
The deadly sins remained popular throughout the Middle Ages, showing up in writing (Chaucer spends some time on them) and art. They are kind of an odd concept -- a European Christian philosophy that doesn't show up anywhere in the Bible. And I'm still baffled as to why anybody who thought that God could forgive all sins (New Testament) also thought he would consign poor mortals to ingenious eternal tortures because of a weakness for pastry. But that's the Middle Ages for you.
There are also seven heavenly virtues, but really, who cares? Sin is always more interesting. The Inferno is more popular than The Paradiso, Paradise Lost more popular than Paradise Regained.
Sin lost a lot of its terror over the course of the 20th century. We still recognize that any passion so overwhelming that it clouds judgment can be bad -- greed, lust, and sloth drive a lot of criminal behavior, for example. And, listening to people talk about their dieting efforts, one definitely gets the impression that gluttony is still considered quite naughty by many people.
Still, I think it's time that we acknowledged the truth: The Seven Deadly Sins have been downgraded to The Seven Rather Bad Habits.