Q&A: Was heaven always a perfect place?
Answer: The assumption built into your questions is that if something is perfect it cannot at the same time contain any sin or evil intention. And your assumptions are not without biblical warrant since we read in the Psalms:
For you are not a God who delights in wickedness; evil may not dwell with you. Psalm 5:4 (ESV)
Yours is a challenging question, but, such don't stop there. There are many other equally challenging ideas. Try this one on for size: If God is pure and without sin how could He possibly create a being such as Lucifer (Satan) who could choose to become the very definition of evil? From that starting point other questions ensue, such as: If God originally created mankind pure and without a sinful nature, how could the first man and woman possibly choose rebellion and disobedience?
Is your head spinning yet? There are a great many things we don't understand about the origin of evil and probably won't understand until we find ourselves in God's never-removed presence. At that time the Apostle Paul promises that we will know even as we are now known. (1 Cor. 13:12) Until then, what we do know is that God is, in Himself, pure and entirely without the stain of sin. We also know that He created beings (angels and humans) who possess the freedom to reject His truth and therefore become sinful and evil — something He Himself can never become. How that is possible is a total mystery and extends into realities that transcend the plane of our experience or knowledge.
I wish I could give a more satisfying answer, but I'm afraid there is none at this time, except to say that somewhere in the sovereignty of an all-powerful and completely perfect God, an allowance was made for the creation of free-will within angels and human beings—the kind of freewill that is powerful enough to actually create evil. Satan not only became the creator of evil, he apparently drew a fair number of the angelic host into his dark heart. And not stopping there, he was allowed to spread his influence even to mankind, where that which was created in God's own image has now become marred and polluted with a nature that is bent and twisted toward sin and selfishness all the time. How these things could come from a perfect God who dwells in unapproachable light is truly beyond our comprehension. We simply know that they did, and trust that His ultimate plan is perfect. (See Isaiah 55: 8-9)