The Pharisees’ goal was to test Jesus. The problem with legalism is that it gets wrapped up in semantics, exceptions, loopholes, etc.
The Pharisees were the keepers of the Law and their objective was to find a flaw in this Jesus guy who was attracting a lot of attention. They wanted to embarrass him and knock him down a few rungs.
How do we still do that with Jesus today?