How Can Sins Happen in Ramadan?
Question

I heard the imam mention that the shaytan is not present in the month of Ramadan. If this is true, why is it hard for a Muslim to stay away from sins during the month of Ramadan even if the Muslim is performing his or her regular duties.
Praise be to Allah.Are devils locked up in Ramadan? 
The idea that the devils are not present in Ramadan is not correct. What is proven from the Prophet (peace and blessings of Allah be upon him) is that the devils are chained up during Ramadan . 
Al-Bukhari (1899) and Muslim (1079) narrated from Abu Hurayrah (may Allah be pleased with him) that the Messenger of Allah (peace and blessings of Allah be upon him) said: “When Ramadan comes, the gates of Paradise are opened, the gates of Hell are closed, and the devils are chained up .” 
How can sins happen in Ramadan?
Al-Qurtubi said: 
“If it is said, How come we see many evil actions and sins happening in Ramadan ? If the devils are chained up that would not happen. 
The answer is that evil actions are reduced on the part of those who fast meeting all the conditions of fasting and taking care to observe the proper etiquette; or that only some of the devils are chained up, namely the marids (strong ones), and not all of them, as it says in some reports; or that evils are reduced in this month, which is something noticeable – fewer evils happen in this month than in others. If all of them were to be chained up that does not mean that evil and sin would not happen, because there are other causes of evil apart from the devils, such as evil souls, bad habits and human devils.” (Fath al-Bari) 
Shaykh Ibn ‘Uthaymin was asked in Fatawa al-Siyam (p. 466): 
How can we reconcile between the idea that the devils are chained up in Ramadan and the fact the people commit sin? 
He replied: 
“The fact that sin happens in Ramadan does not contradict the report that the devils are chained up in Ramadan, because the fact that they are chained up does not prevent them from moving. Hence it says in the hadith: “And the strong devils are chained up, and they cannot achieve what they usually achieve (at other times).” Narrated by Ahmad, 7857; this hadith was mentioned by al-Albani in Da’if al-Targhib, 586; he said: it is da’if jiddan (very weak). 
It does not mean that the devils do not move at all, rather they can move and lead people astray, but their activities during Ramadan are not like their activities at other times.”
And Allah knows best.