During fast, abstaining from only eating and drinking is not sufficient to achieve piety but realistic and sincere effort is demanded from a fasting person to avoid all kinds of sins.
Prophet (S.A.W.) said that Allah Said:
“Whoever does not give up evil and ignorant speech, and acting in accordance with that, Allah has no need of his giving up his food and drink.”
(Ibn Majah: 1689)