Praise be to Allah.
Al-Bukhaari (1903, 6057) narrated that Abu Hurayrah (may Allaah be pleased with him) said: The Messenger of Allaah (peace and blessings of Allaah be upon him) said: “Whoever does not give up false speech and acting upon it, and ignorance, Allaah has no need of him giving up his food and drink.”
The phrase “false speech” includes lying, backbiting, spreading slander and bearing false witness, and every kind of speech that is haraam.
Acting upon it means doing evil and immoral actions. See Tuhfat al-Ahwadhi.
Ignorance means committing all kinds of sins. This was the view of al-Sindi in Haashiyat Ibn Maajah.
With regard to the phrase “Allaah has no need of him giving up his food and drink”, Ibn Battaal said: This does not mean that he is to be told to stop fasting, rather it is a warning against false speech and the other things mentioned along with it… this is an indication that (his fast) is not accepted… what is meant is that a fast that is contaminated with falsehood is rejected and that a fast that is free of that is aceepted.
Ibn al-‘Arabi said: This hadeeth implies that whoever does the things mentioned here will not be rewarded for his fast. What is meant is that the reward for fasting cannot outweigh the sin of false speech and the other things mentioned here.
What is meant is that all sins have an effect on the fast and thus reduce the reward for fasting. The reward may be cancelled out altogether if there are too many sins.
So you have to continue to strive against yourself until you give up this evil habit. Every time you sin you have to repent and seek forgiveness, for the one who repents from sin is like one who did not sin at all.
May Allaah help us to do that which He loves and which pleases Him.