Let me answer from a Christian perspective. The criteria for making heaven is more than just being good. You also need to be born again, acknowledge Jesus as your lord and personal saviour and believe in him. There are many good people out there such as Atheists that doesn’t meet up with this criteria so you know what that means.
For the second part of your question, I think the purpose of creating the earth is to serve as a test/examination ground for qualification & entrance into heaven.
We will be happy to hear your thoughts


