What does Matthew 12:5 mean?
Jesus is challenging some Pharisees who have accused His disciples of breaking the Law of Moses. They were breaking off heads of grain and eating them while walking through a field on the Sabbath (Matthew 12:1–2). The Pharisees' official position claimed such a thing was "work," so when done on the Sabbath it was a violation of the fourth of the Ten Commandments (Exodus 20:8–11).In response, Jesus asked if they have read of the time David took holy bread from the temple in a desperate situation (1 Samuel 21:1–6). David's action, and the aftermath, showed the purpose of the law went beyond mindless literalism.
Now Jesus continues asking His questions. The same Law of Moses, cited by the Pharisees, notes that priests are permitted to "work" as they serve in the temple on the Sabbath. Those tasks are their routine jobs. The Law, however, declared them guiltless because they were doing what God commanded them to do.
Again, Jesus is showing that the Law of Moses was not intended to elevate the law above a prayerful respect for God's will. The priests served God first, as they must. They did not serve a wooden interpretation of the words, while telling God to wait. That would have been backwards and would have broken the very purposes for which God gave that rule. Jesus will show that the Pharisees also approach the law backwards. Their extra rules undo the real intent of God's laws, meant for the good of God's people.