This does not mean a believer can sin and still be saved because they have a belief alone on Jesus. Jesus did not say that the bad fruit we do is now good fruit because we believe on the finished work of the cross. The Bible does not use such immoral words. It literally means if Christ abides in you, then good fruit (righteous acts) and not bad fruit (grievous sin*) will follow. The good tree is Jesus. We have been changed and the Lord shines His light through us. In context (if you were to accept it), says that everyone who does not do what He says is like a fool who built his house upon the sand and when a storm came, great was the fall of that house (Matthew 7:26-27). It's why Jesus told those believers to depart from Him in Matthew 7:23. Yes, they did wonderful works (Matthew 7:22), but they also worked iniquity or sin, too. So doing both good and evil did not help them. Jesus said depart from me you that work iniquity. This is why Jesus did not know them (See: 1 John 2:3-4). For to break God's laws or commands is sin (1 John 3:4), and we have to know God in order to have eternal life (John 17:3). For the one who says they know the Lord and they do not keep His commandments is a liar and the truth is not in them (1 John 2:4). What truth is not in them? Jesus. For Jesus is the way, the truth, and the life (John 14:6).
For we know that everyone who does righteousness is born of Him (1 John 2:29), and he that commits sin is of the devil (1 John 3:8).
Side Note:
*Grievous sin is any exceptionally serious sin that the Bible specifically warns with warnings of hellfire and or condemnation if a person does not repent (i.e. they refuse to confess and forsake their sin). Examples would be Matthew 5:28-30, Matthew 6:15, Matthew 12:37, Matthew 19:17-19, Matthew 25:31-46, Luke 9:62, Luke 10:25-28, 1 Corinthians 6:9-10, Galatians 5:19-21, 1 John 3:15, Revelation 21:8, Revelation 22:14-15). For Proverbs 28:13 in part basically says that the person who confesses and forsakes sin shall have mercy. Many of these truths in Scripture simply go ignored by most of Christianity today. They are not reading and believing all of their Bible and they are only picking and choosing what parts of the Bible they want to believe in (Based on maintaining their current lifestyle).
Why do you apply an interpretation to the scripture?
Matthew 7:21-23
Not everyone who says to Me, ‘Lord, Lord,’ will enter the kingdom of heaven,
but he who does the will of My Father who is in heaven will enter. Many will say to Me on that day, ‘Lord, Lord, did we not prophesy in Your name, and in Your name cast out demons, and in Your name perform many miracles?’ And then I will declare to them, ‘
I never knew you; depart from Me, you who practice lawlessness.’
An interpretation of this paragraph is impossible because the plain reading of the paragraph, is clear and concise.
Only those who do the will of the Father will enter heaven.
So does the scripture clearly tell us what the will of the Father is?
John 6:40
For
this is the will of My Father, that everyone who beholds the Son and
believes in Him will have eternal life, and I Myself will raise him up on the last day.
There is no debate, the will of the Father is clearly stated.
In the paragraph (Matthew 7:21-23) Jesus tells us in no uncertain terms what is the cause of lawlessness.
‘
I never knew you; depart from Me'
Even though the works were identical to the works that the apostles performed. These works could not conceal, the fact, that these folk, even though they used the very name of Jesus. They simply did not believe in Jesus, Jesus never knew them.
John 3:18
He who believes in Him is not judged; he who does not believe has been judged already, because he has not believed in the name of the only begotten Son of God.