Why Can Believers Still Sin?
Summary: As a believer, only your inner spirit has been redeemed and made righteous; your mortal body has not yet been redeemed and, therefore, can still sin (Romans 8:10). Whereas your inner spirit will inherit eternal life, your physical body will go to the grave when you die (1 Corinthians 15:50). Because of your inability to live righteously by your own human efforts, God has given you the faith of Christ (Galatians 3:11), which is not something you do but is Christ in you living out His righteous life through you (Galatians 2:20).
When you trust in Jesus Christ as the Son of God and Savior, God removes your old sinful inner nature and replaces it with a brand new, clean heart. As a clean "vessel" for the first time, the Spirit of Christ now has a place within you where He can live. Jesus joins His Spirit eternally as one to your new spirit (1 Corinthians 6:17). Christ's indwelling presence makes you literally righteous because His life is now your life. And, you are saved because you now possess Christ's eternal life (1 John 5:11,12).
The righteousness and eternal life that God gives you through Jesus Christ makes you a completely new person in your new, inner spirit (2 Corinthians 5:17).
2 Peter 1:4 For by these He has granted to us His precious and magnificent promises, in order that by them you might become partakers of the divine nature, having escaped the corruption that is in the world by lust.
Why Can You Still Sin?
So, if you are truly a righteous child of God, how can you still sin? Here is the reason: although you are new and righteous in spirit, your mortal body is not new; it is exactly the same as it was before you were saved. Your physical body has not yet been redeemed and, therefore, it has not yet been freed from sin in the way your inner spirit has been completely and forever freed from sin (Romans 6:7,18,22; 1 John 3:9). This is why your mortal "house" causes you to "groan" ...
2 Corinthians 5:2,4 For indeed in this house we groan, longing to be clothed with our dwelling from heaven, ...  For indeed while we are in this tent, we groan, being burdened, because we do not want to be unclothed but to be clothed, so that what is mortal will be swallowed up by life.
You are spiritual perfection living inside mortal imperfection.
Romans 8:10 If Christ is in you, though the body is dead because of sin, yet the spirit is alive because of righteousness.
Difference Between Body and Spirit
Although many do not teach the distinction between body and spirit, the Bible specifically teaches it.
2 Corinthians 4:16 Therefore we do not lose heart, but though our outer man is decaying, yet our inner man is being renewed day by day.
Ephesians 3:16 That He would grant you, according to the riches of His glory, to be strengthened with might by His Spirit in the inner man;
To further understand this duality, consider what happens when believers die: their bodies go the grave because they have not yet been redeemed or made righteous, but their spirits are already one with the Lord forever because they have already been redeemed and made righteous.
Why Aren't We Perfect?
So, why would God leave us in this "in-between" state of being partly righteous and partly still dead to sin? There may be several reasons but one is to maintain your dependence on God. Living by faith is living in oneness with Jesus Christ.
2 Corinthians 4:7 But we have this treasure in earthen vessels, so that the surpassing greatness of the power will be of God and not from ourselves;
As a believer, you have immense power residing in you because you have the same Holy Spirit living in you that Jesus had when He was here on this earth! Everything that Jesus did during His ministry was done by the power of the Holy Spirit within Him. Jesus did not do any of the works of God by His own human abilities. Rather, it was the Father in Him who did His works (John 14:10) while Jesus lived by faith (John 5:30; 8:28). This is why Jesus is not only your Savior but also your model for the life of faith.
Your weak mortal flesh serves as a constant reminder that the power within you is from God and not of yourself. By your own human strength, you have no capacity to do the works of God or live a life of righteousness. Yet by faith, as a member of the Body of Christ, believers will do even greater works than Jesus did.
John 14:12b ... he who believes in Me, the works that I do, he will do also; and greater works than these he will do; because I go to the Father.
As Jesus Christ lives out His righteous life in you and does His good works through you, you become the hands, feet, and voice of Christ in the world today.
Galatians 2:20 I have been crucified with Christ, and it is no longer I who live, but Christ lives in me; and the life which I now live in the flesh I live by faith in the Son of God, who loved me, and delivered Himself up for me.