Praise be to Allaah.
It is haraam for men to shave their beards during Ramadaan and at other times, because of the saheeh ahaadeeth which clearly enjoin allowing the beard to grow.
For example, the Prophet (peace and blessings of Allaah be upon him) said: “Be different from the mushrikeen: let your beards grow and trim your moustaches.” Narrated by al-Bukhaari, 5892; Muslim, 259.
And he said: “Trim the moustache and let the beard grow; be different from the Magians.” Narrated by Muslim, 260.
The great scholar Ibn Muflih (may Allaah have mercy on him) said:
Ibn Hazm stated that there was scholarly consensus saying that trimming the moustache and letting the beard grow are obligatory.
Shaving the beard is not one of the things that break the fast, but it does detract from the reward of the fasting person. The same applies to other sins such as lying, backbiting, and so on.
Shaykh Ibn ‘Uthaymeen (may Allaah have mercy on him) was asked: Does engaging in haraam kinds of speech during the day in Ramadan invalidate a person’s fast?
If we read the words of Allaah (interpretation of the meaning):
“O you who believe! Observing As-Sawm (the fasting) is prescribed for you as it was prescribed for those before you, that you may become Al-Muttaqoon (the pious)”
we will understand that that the reason behind the enjoining of fasting is so as to instill piety. Piety means giving up haraam things, and in general means doing what is enjoined and abstaining from what is forbidden.
The Prophet (peace and blessings of Allaah be upon him) said: “Whoever does not give up false speech and acting in accordance with it, or ignorance, Allaah has no need of his giving up his food and drink.” Narrated by al-Bukhaari, 6057.
Based on this, it is most important that the fasting person avoids haraam words and deeds. So he should not backbite about people, 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 such things for a whole month, then he will remain righteous for the rest of the year. But unfortunately many of those who fast do not differentiate between a day when they are fasting and a day when they are not fasting. So they continue to speak and act as they usually do, engaging in haraam actions such as lying, cheating and so on. You cannot sense the dignity of fasting in them at all. These actions do not invalidate the fast but they do detract from its reward, and when they are done continually they may cancel the reward of fasting altogether.
From Majmoo’ Fataawa al-Shaykh Ibn ‘Uthaymeen, vol. 19, question no. 233.