The Unacceptable Fast (Hadith No. 1622)

Volume 3, Book 31, Number 127:
Narrated Abu Huraira (radiallaahu `anhu):
The Prophet (sallallaahu `alayhi wasallam) said, "Whoever does not give up forged speech and evil actions, Allah is not in need of his leaving his food and drink (i.e. Allah will not accept his fasting.)"
This tells us two things mainly:
  1. The person who's fasting MUST avoid major sins e.g. lying, and all sorts of evil actions.
    The Prophet (peace and blessings of Allaah be upon him) said: “The five daily prayers, from one Jumu’ah to the next and from one Ramadaan to the next are expiation for (sins committed) in between, so long as you avoid major sins.” [Muslim]
    Repeat the last phrase: " long as you avoid major sins".
  2. Fasting is not just about leaving food and drink. There's much more to it. This exercise of avoiding halal food and drink in obedience to Allah's command is supposed to teach us how to leave the haram things (sins, for example) during and outside Ramadan in order to obey Allah (subhaanahu wata`aalaa). If you can fast, you can leave sins as well. It's not impossible. :)