If God knew beforehand that his perfect creation would be damaged by sin and we would suffer as a result, why did he create the world?
We will have to ask God this question when we enter heaven. Because he wanted to glorify himself through us is the best answer we have today.
God was not lonely. He already had Jesus, the Holy Spirit, and his loyal angels for companionship.
God did not need to express his creativity. He had already created the heavenly realm.
God did not need admirers. The heavenly angels already worshipped him.
We know God highly values the world, because he took steps to preserve it after Adam and Eve sinned.
We know he has special regard for humanity, because he gave us higher rank in his kingdom than the angels and unprecedented authority over the earth.
However, his specific motivations for creating the world, and us, are unknown.