Have you ever taken a big bite out of a Red Delicious apple, only to find that it was rotten to the core? I think we would all agree that biting down on a decayed piece of apple is not a pleasant experience. You immediately feel the need to spit the terrible-tasting fruit out of your mouth. You wouldn't dare consider swallowing the disgusting rotten apple. It simply does not belong inside your body.
In a similar way, Jesus has said that God will not tolerate people who are "rotten" on the inside. While Jesus was on the Earth, there were certain groups of Jews known as the scribes and Pharisees who seemed to be righteous on the outside, but inwardly they were "rotten." In fact, they were so full of sin on the inside that Jesus warned other listeners saying, "Unless your righteousness exceeds the righteousness of the scribes and Pharisees, you will by no means enter the kingdom of heaven" (Matthew 5:20).
These two groups of Jewish men prided themselves on knowing the Old Testament. They could quote numerous verses and recite many of the Old Testament stories. People often went to them for advice when wanting to understand the Old Testament better. In the Sermon on the Mount, however, Jesus condemned these men (and anyone else who is like them) for their lack of sincerity.
The scribes and Pharisees correctly stressed the sinfulness of various outward actions of people (like murder and adultery), but they failed to teach about the possibility of people sinning on the inside. Jesus wanted people to know that it's not just murder that is wrong, but also the hatred that leads to murder (read Matthew5:21-26). And, it is not only adultery that is wrong, but also the evil thoughts that lead a man or woman to want to have a sexual relationship with someone who is not his or her lawful spouse (read Matthew 5:27-32). Jesus demands that His followers cast sinful thinking from their minds. You see, Jesus not only wants us not to do bad things (like stealing, cheating, lying, and fighting), He does not even want us to think about doing bad things. In fact, Jesus wants us to replace bad feelings with good thoughts. Then we can love both our friends and our enemies (read Matthew 5:43-48).
To sum it all up, real righteousness is on the inside and the outside.