RESPONSE: That is an excellent question. It is also one that requires a largely speculative answer. While Scripture explicitly says that there will be no sin in heaven (Rev 21:27), it does not say much about the how and why. I just want to say that up front so that you will know that what I am about to say, while based on Scripture, is basically just a theory that makes sense to me.
According to the Bible, there are two types of creatures that are capable of sinning: angels and humans. I think that we (humans) can learn a lot about the eternal state by examining how God has responded to the sin of angels. You may have never considered this, but there is no Gospel for fallen angels. Salvation is not offered to demons. They have been actualized in their decision to reject God. There is also no reason to think that the angels who remained faithful to God are in danger of falling into sin in the future. Once again, it seems that they have been actualized in their decision to trust Him.
Based on what we know, I think it is reasonable to speculate that there was a time period during which God allowed angelic beings to choose whether to love or reject Him. However, that time came to an end with the excommunication of Lucifer and those who followed him. Some have further speculated that during this time, God temporarily veiled His full glory. He kept the angelic beings at a sort of "arms length" from experiencing Him in a way that would have overridden their ability to choose to either love Him or reject Him.
I think that something like this dynamic is at work with humanity now. God has allotted a time period during which His full glory is veiled so as not to override human freedom. However, a time is coming when all be will be actualized in their choice to either accept or reject God. For those who die prior to that day, death is the trigger to their actualization (Heb 9:27). But it isn't that God just arbitrarily transforms some people into the likeness of Christ so that they will be without sin. Rather, salvation is based entirely upon being "in Christ." Thus, those who are in Christ will be made like Christ. How will they be actualized into this state? I believe it has, at least in part, to do with God finally revealing (unveiling) the fullness of His glory to humanity. 1 John 3:2 says: "But we know that when Christ appears, we shall be like him, for we shall see him as he is." Some have suggested that fully experiencing God will make it so that, while sin will technically be possible in eternity, no one would ever want to sin. I think there is more to it than that. Those who are in Christ will see the full glory of God's perfect holiness, and will be accepted on the basis of Christ's righteousness--transformed/actualized into His likeness. They will be like Shadrach, Meschach, and Abednego; because of Christ, the flames (God's perfect justice) will not harm them, but set them free. On the flipside, those who are not in Christ will see the full glory of God's perfect holiness of God and will be unable to stand--transformed/actualized into the likeness of their own sin, and they will not be safe from the flames.