Your approach here is that sin is exclusively involved in doing, but the real problem is not one so much of doing but rather being. Yes, you should not do acts of sin, but the real problem is the make-up of a person's core inner being.
Humans are spirits having a temporary physical experience. However they are fallen spirits, and by virtue of the fallen spirit being separated from God, when the spirit leaves the body, if still separated from God by its fallen nature, goes to the realm of fallen spirits. Since spirit is eternal, the fallen spirit stays in this realm forever.
While people should do good and not commit acts of sin, this alone does not change a person's inner fallen nature. The solution involves removing the inner fallen nature and replacing it with a new inner nature that is connected with God. Then when the spirit leaves the body, the person goes to be with God, since she no longer is a fallen spirit.
Think of sin not so much as what a person does, but rather something that a person is. ( I know that sin is also an action, but stems from a person's nature)