Why were these traps created in the first place?
Philosophy might be that they also serve as "protection" against hell.
Many people would not be ready for the "strictness" of Allah’s laws,
and so Allah became the grant,
and provided humanity with safety from the agonies of hell, which are even greater and truly infinite.
The philosophy is that when a person is reincarnated, they get a "second" chance.