The prison is a necessary institution of the governmental establishment for those who are disobedient to the laws of the government. Similarly, this material world, full of miseries, is a temporary creation of the Lord for those who have forgotten Him
SB Canto 2
My dear son, I have now explained in brief the Supreme Personality of Godhead, who is creator of the manifested worlds. Without Him, Hari, the Lord, there are no other causes of the phenomenal and noumenal existences.
Since we generally have the experience of the temporary, material world and conditioned souls trying to lord it over the material worlds, Brahmājī explained to Nāradadeva that this temporary world is the work of the external potency of the Lord and that the conditioned souls struggling here for existence are the marginal potency of the Supreme Lord, the Personality of Godhead. There is no cause for all these phenomenal activities but Him, Hari, the Supreme Lord, who is the primeval cause of all causes. This does not mean, however, that the Lord Himself is distributed impersonally. He is aloof from all these interactions of the external and marginal potencies. In the Bhagavad-gītā (9.4) it is confirmed that by His potencies alone He is present everywhere and anywhere. Everything that is manifested rests on His potency only, but He, as the Supreme Personality of Godhead, is always aloof from everything. The potency and the potent are simultaneously one and different from one another.
One should not deprecate the Supreme Lord for the creation of this miserable world, just as one should not blame the king for creating a prisonhouse in the government. The prisonhouse is a necessary institution of the governmental establishment for those who are disobedient to the laws of the government. Similarly, this material world, full of miseries, is a temporary creation of the Lord for those who have forgotten Him and are trying to lord it over the false manifestation. He, however, is always anxious to get the fallen souls back home, back to Godhead, and for this He has given so many chances to the conditioned souls via the authoritative scriptures, His representatives, and personal incarnations also. Since He has no direct attachment to this material world, He is not to be blamed for its creation.