Have you ever heard the claim that "obedience to God's Law is by definition, salvation by works"? Well, that's a lie! According to Deuteronomy 13, those that love Yahweh obey his Law. And those that rebel against his Law by definition, practice idolatry! Is it possible that someone will keep Yahweh's Law as a means of salvation? Yes. But there are other reasons to keep the Law of Yahweh. For example, to prove that you love Yahweh. Or to prove that they believe in Yeshua. Yeshua said that those who love him will keep his commandments (John 14:21). And Yeshua commanded us to live on every word of Yahweh (Matthew 4:4). You are not living on every word of Yahweh if you are rebelling against his Law!
This misunderstanding concerning obedience is understandable. Simply put, the teaching that, "one cannot be saved so long is one is living in rebellion", can be easily misinterpreted as saying that it's the obedience that saves you, rather than faith in Yeshua. For example, Hebrews 10:26 makes it clear that those living in rebellion have no atonement. But it is also clear from other passages, such as Romans 3:19-20, make it clear that, even if one were to stop rebelling against Yahweh's Law, they would still not be saved! And Yeshua said, "Therefore I say to you, every sin and blasphemy will be forgiven men, but the blasphemy against the Spirit will not be forgiven men [Matthew 12:31; NKJV]." So the one who stops their rebellion will be forgiven of their rebellion.
While this may look like salvation by works, it's not. It only looks that way because living in rebellion will prevent you from being saved. If someone stops rebelling against Yahweh's commandments, that does not automatically mean they are saved. It just means they can be saved. Salvation still comes from believing in Yeshua. All this can be summed-up by the following saying: "Obedience cannot save you, but rebellion will condemn you." You might have also heard this saying: "We do not keep the Law to be saved. We keep the Law because we're saved."
There are some things that need to be addressed. The ultimate reason that this misunderstanding exists is because Satan wants to keep us away from Yahweh. And he does that by deceiving us into believing that the Law is bad, and that keeping it is bad. Yeshua warned against this tactic when he said, "These people draw near to Me with their mouth, And honor Me with their lips, But their heart is far from Me. And in vain they worship Me, Teaching as doctrines the commandments of men [Matthew 15:8-9; NKJV]." Their hearts are far from Yahweh because they do not keep his commandments. So now you know that drawing close to Yahweh starts with keeping his Law.
There are of course human motivations for believing that obedience is salvation by works: People do not like change! They want to continue in their ways and their hearts deceive them into making excuses for continuing in what they now know is sinful. This is an excellent example of the mind being governed by the flesh not being able to submit to Yahweh's Law, as Paul warned about in Romans 8:7. For teachers, there is even more motivation to teach this: Money and/or power! Or rather, the love of money and/or power. People generally have itching ears and will not tolerate anyone who does not tell them exactly what they want to hear (2 Timothy 4:3-4)! And guess what: You can't maintain a Church building if nobody is there to give their "tithe" to the Church. Then there are the wolves! These teachers know the truth, and teach the opposite. It is their job to make sure that you perish in the Lake of Fire! By the way, the more people realize that God expects us to keep his Law, the more wolves will make themselves known.