As revealed in Jesus, God's Love is God's Law.
God said to the Israelites in Deuteronomy 6: If you love me you will keep my commandments. Jesus said it again in Matthew 5:18-20. In both Deuteronomy 6 and Matthew 5 it is the same. Love lived = Law lived. The end-all-be-all of the Law is "love God and love mankind." When considering this Law, Ellen White wrote: "To love God with all the heart is the first great law of the universe. When the love of God fills the heart, love to our fellow men will flow forth in words and deeds as the fruit of that love." (RH May 3, 1898: God’s Standard of Character)
The "least in the Kingdom of God" (Matthew 5:19) is someone who, having knowledge of God's love in Jesus, does not teach God's love but teaches the opposite. This is why legalism is so devastating!
Interestingly, Jesus does not write off "the least in the Kingdom of God" but says they are greater than John The Baptist (Matt 11:11)! Which means, because of when they live, they have the knowledge of what Christ did on the cross and the knowledge of the Holy Spirit poured out on Pentecost. John was full of doubt because he didn't know the glory of God's love as shown on the cross or the powerful comfort of the Holy Spirit.
These people who teach other than God's law of Love still have great potential for the Kingdom of God because they know of Christ's death and the Spirit's power and presence. Jesus is making it clear that His mercy is available even for the Pharisee, the legalist and the self-righteous. Why? Because while we were yet sinners, He died for each of us!
What amazing grace!
In Matthew 5, Jesus is leading the hearer away from a doing (hand) oriented interpretation of righteousness and toward a being (heart) interpretation. You've heard it said, do not (hand/act) but I say if you (heart/feel) ...
He's drawing us toward recognising love as the decision-maker. What would love do? This reaches its apex in the final 6 verses of chapter 5 and then falls into more examples in chapter 6.