Asking why the world was created is really a question to be answered by religion.
I'd say most members here when talking about God are referring to the God of the Bible.
The creation story is in the Old testament, so we look for clues there.
When we look there, I think the answer is rather obvious.
The God of the Old Testament, yahweh, is nothing more than an animal, a bloodthirsty, disgusting creature who revels in the suffering and death of countless millions of men, women and children.
Yahweh is evil, pure and simple, and it is obvious that He created the world for His sick pleasure.
Yahweh is a barbarian, a sadistic creature whose only pleasure is to sit back and laugh at millions of babies starving to death, little children suffering with a range of cancers, old people that can barely walk and suffering from a range of painful disorders all created by Yahweh for his amusement.
So, the world was created by an evil, bloodthirsty, sadistic animal for His own pleasure.
Brian.