The Old Testament Law was given to the Jews by God as His guidelines for how they should live. Over time, following "the rules" became more important than the reason for them.
When Jesus came, He reminded everyone that while people tend to look at what people do, God looks at our hearts and motivations too.