Fasting is one of the best acts of worship. It is mandated by Allah (SWT) to purify the soul along with the practice of good deeds. Thus the faster ought to be aware of acts or behaviors that may spoil his fast so that he or she will attain the highest benefit physically and spiritually.
Fasting is not only restraining oneself from fast-breakers - food, drink, and sex - that restrain only the mouth and the private parts. Every limb (jawarih) must be restrained. The tongue must desist from slander and back-biting. The eyes must restrain themselves from any unlawful look. The hand must not touch or take what does not belong to it. The ears must not listen to idle talk, gossip, lyrics, and notes that contain obscene and indecent things; the nose must fast also by not sniffing, or smelling unlawful things. The feet must fast by not going to places where sinful acts are propagated. When you eat sehri and iftar, make sure the food on the table has been obtained lawfully. If the servant has observed the fast in these terms and acted accordingly, he or she will have gained positively by Ramadan and will receive the maximum reward.
Hence, fasting is a state of mind that transcends physical restraint. In a hadith by Abu Hurairah, the Messenger of Allah (saas) said: "It is not fasting, just to restrain from food and drink, instead the fast is to cease from an idle talk (laghw), obscenity, and should anyone insult or provoke you, or act ignorantly towards you, respond to it by saying, 'I am fasting, I am indeed fasting.'" (Ibn Khuzaimah)
In another citation reported by Abu Hurairah (raa) the Messenger of Allah, (saas), said: "He who does not stop from false talk or stop from acting upon false talk, Allah will have no need that he abstain from his food and drink." (Bukhari)
Again, in the same spirit, the Messenger of Allah (saas) said: "Many an observer of fasting will not receive from his fasting any reward but the pain of hunger and many a night worshipper will not receive any reward from his prayer but the loss of sleep." (Nasaie and Hakim)
These three ahadith are evidence that the most important thing in the eyes of the Lawgiver is not merely physically restraining from the obvious food and drink, but the total commitment of the servant's body and soul to the letter and spirit of fasting. The curfew of the body and mind during the state of fasting enables the person who has fasted in the true spirit of Ramadan to have the necessary requirements to withstand the turbulence of life for the next eleven months.
When the Messenger of Allah (saas) said in the hadith, "Allah will have no need..." (Bukhari), he was indicating the depth or seriousness of this case. If you fail the test, Allah will have no need that abstained... from that test. If Allah rejects the test, who else will accept it? Nobody! Hence, the pain of hunger and the burning of thirst will go unrewarded.