In Matthew chapter 5 Jesus was explaining the physical sins of adultery, murder, etc. Then He explained that even if a man thinks these in his heart he has committed these sins. Was Jesus teaching us to live more purely or was He teaching us that it is impossible to live a sinless life and we need a savior?
The purpose of the Lord’s teaching In Matt. 5:17-48 was to show us that God’s Law will always be the standard by which our righteousness, our acceptability to God, would be determined.
He said in order to enter the Kingdom of Heaven we need to be more righteous than the Pharisees (Matt. 5:20). They were obsessive about keeping the Law, even to the smallest detail, and were better at it than anyone else.
After giving examples to show that God doesn’t judge us by our actions alone but also by the motives of our heart, He ended by saying we have to be perfect, as God is perfect (Matt. 5:48).
His point was that even at our very best we can’t meet God’s standards for entry into the Kingdom, because on our own we can never be as perfect as God is. A single thought will condemn us.
Later, Paul wrote that a righteousness from God, apart from the Law, has been made known. This righteousness comes through faith in Jesus Christ to all who believe (Romans 3:21-22). In other words, because we believe the Lord’s death paid for all our sins we can meet God’s standards after all, because when Jesus offered for all time one sacrifice for sins, He made perfect forever those who are being made holy (Hebrews 10:12-14).