Praise be to Allah. Allah has prescribed fasting for great reasons. One of the most important of these reasons and one of the greatest purposes achieved by the fast is so that we may attain piety (taqwa), as Allah says: O you who believe! Observing As-Saum (the fasting) is prescribed for you as it was prescribed for those before you, that you may become Al-Muttaqoon (the pious). (Qur’an 2:183)
Taqwa or piety means obeying that which Allah has commanded and avoiding that which He has forbidden.
The person who is fasting is commanded to do acts of worship and obedience, and he is forbidden to do haraam things. Sins are bad enough when committed by anyone, but they are even worse when committed by one who is fasting. Hence the Prophet (peace be upon him) said: “Whoever does not give up false speech and acting in accordance with it, and ignorant conduct, Allah has no need of him giving up his food and drink. (Al-Bukhari)
Ibn Khuzaymah, Ibn Hibban and Al-Hakim narrated that Abu Hurayrah (may Allah be pleased with him) said: The Messenger of Allah (peace be upon him) said: “Fasting does not just mean giving up food and drink, rather fasting also means giving up idle and obscene talk. (Sahih Al-Targheeb)
Secondly, a woman’s making a wanton display (tabarruj) of her beauty and charms to non-mahram men detracts from the reward of fasting. The more sins are committed and the more serious they are, the more that detracts from the reward of fasting, and it may cancel out the reward altogether, so that a person may have denied himself food, drink and all the things that invalidate the fast, yet still is deprived of the reward for that by disobeying Allah.
Hence the Prophet (peace be upon him) said: “The one who fasts may get nothing from his fast but hunger, and the one who performs qiyaam (salah) may get nothing from his qiyaam but a sleepless night.” – Narrated by Ibn Maajah.
Thirdly, with regard to fasting that is accompanied by sins – including tabarruj on the part of a woman – the fast is not invalidated by that, rather it is valid and the fasting person has fulfilled his obligation and does not have to make up for the fast. But the reward for fasting gets decreased owing to that sin and it may be cancelled out altogether as stated above.
Al-Nawawi said in Al-Majmou: The fasting person should protect his fast from backbiting and slander. What this means is that it is more important for the fasting person to avoid these sins than others, although those who are not fasting should avoid these sins too, as that is the command for all situations. If a person backbites while fasting, he has committed a sin but that does not invalidate his fast in our view.
This is the view of Malik, Abu Hanifah, Ahmad and all the scholars except Al-Awzai‚ who said that the fast is invalidated by backbiting, and must therefore be made up.
Based on this, the fasting person has to avoid haraam words and actions, so he should not backbite people, or tell lies, or spread malicious gossip amongst them, he should not engage in haraam transactions, and he should avoid all haraam things.
If a person avoids that for a whole month then he should be able to adhere to that straight path for the rest of the year. But unfortunately many of those who fast do not differentiate between the days when they fast and the days when they do not fast, so they carry on as usual with haraam speech such as lying, cheating and so on. You do not feel that they are observing the sanctity of fasting. These actions do not invalidate the fast but they do detract from its reward, and may cancel out the reward of fasting altogether.