Allah’s wisdom in letting a person commit sin
These are the words of Ibn al-Qayyim in his book Tareeq al-Hijratayn, where he speaks of Allah’s wisdom in letting a person commit sin, enabling him to do so and preparing all the means for him that lead to that.
If He willed, He could have protected him and prevented him from doing that, but he let him do that for great and wise reasons that no one knows in their entirety except Allah.
Among these reasons, he mentioned: “He causes him to forget his own acts of obedience and makes him focus on his sin, so that it continues to preoccupy his mind.
For when Allah wills good for a person, He makes his good deeds invisible to him and diverts him from mentioning them, and He distracts him by causing him to focus on his sin, so that he is always thinking of them, until he enters Paradise.
So he does not think of his deeds that are already accepted, and he does not mention them.
One of the salaf (early generation) said: A person may commit a sin and enter Paradise because of it, or he may do a righteous deed and enter Hell because of it.
They said: How is that? He said: He commits a sin then keeps thinking of it, and when he remembers that he regrets it, feels sorry, beseeches Allah, hastens to erase it and feels brokenhearted and humble before his Lord, and that removes self admiration and pride from him.
Or he may do a good deed then keep thinking of it, talking about it, feeling proud of it and feeling arrogant because of it, until he enters Hell.”
End quote from Tareeq al-Hijratayn, p. 169-172