It’s commonly held that because the devils are chained up during Ramadan, anything bad that is done is entirely from the perpetrator, the devil cannot be blamed since he was not present nor working his misguidance. This view is taken from the following hadith (prophetic narration) reported by Abu Hurairah:
“When Ramadan comes, the gates of paradise are opened, the gates of hell are closed, and the devils are chained up.”
al-Bukhari and Muslim
In short, this hadith can be taken (for brevity) in two ways since there doesn’t seem to be much context related around it.