We often wonder on the below hadith ” If the devils are chained up then why men still commits sins during Ramadaan? “ Al-Bukhaari (1899) and Muslim (1079) narrated from Abu Hurayrah (may Allaah be pleased with him) that the Messenger of Allaah (peace and blessings of Allaah be upon him) said: “When Ramadaan comes, the gates of Paradise are opened, the gates of Hell are closed, and the devils are chained up.”
Shaykh Ibn ‘Uthaymeen (may Allaah have mercy on him) was asked about the words of the Prophet (peace and blessings of Allaah be upon him) “and the devils are chained up,” – yet we still see people suffering from epilepsy during the day in Ramadaan, so how can the devils be chained up when some people are suffering epileptic fits?
He replied: In some versions of the hadeeth it says “and the strong devils (maarids) are chained up” – this is narrated by al-Nasaa’i. This hadeeth is speaking of matters of the unseen, so we have to accept it and not discuss it any further. This is safer for a person’s religious commitment. Hence when ‘Abd-Allaah, the son of Imam Ahmad ibn Hanbal said to his father, “Some people suffer epileptics fits during the day in Ramadaan,” the Imam said: “This is what the hadeeth says and we do not discuss this.” Moreover it seems that what is meant by their being chained up is that they are prevented from tempting people, based on the fact that there is a great deal of goodness and many people turn to Allaah during Ramadaan.
Majmoo’ al-Fataawa, 20.