This stems from the instructions given in Leviticus 24:5-9:
And you shall take fine flour and bake twelve cakes with it. Two-tenths of an ephah shall be in each cake. [This is the showbread (I Samuel 21), the subject under discussion in Matthew 12.] You shall set them in two rows, six in a row, on the pure gold table before the LORD. And you shall put pure frankincense on each row, that it may be on the bread for a memorial, an offering made by fire to the LORD. Every Sabbath he shall set it in order before the LORD continually, being taken from the children of Israel by an everlasting covenant. And it shall be for Aaron and his sons, and they shall eat it in the holy place; for it is most holy to him from the offerings of the LORD made by fire, by a perpetual statute.
These five verses together with I Samuel 21 explain that, not only did the priests put the bread in the sanctuary, but they also baked it on the Sabbath. Thus, it was hot when they put it in the Holy Place on the Sabbath—right out of the oven. Was it lawful for a woman, in the ordinary course of her household responsibilities, to bake twelve loaves of bread on the Sabbath? It was not. This is the illustration that Jesus utilizes in Matthew 12.
“The priests in the temple profane the Sabbath, and are blameless.” They not only did these things, they were also made sacrifices on that day, which consisted of a great deal of labor. Why, then, were they “blameless”? For the same reason that Jesus justified healing on the Sabbath (in John 5) and the same reason that the priests were blameless for circumcising on the Sabbath: They were doing the work of God, the work of salvation. They were fulfilling a purpose on the Sabbath that somebody had to do. This is the issue throughout John 5, 7, and 9.
Christ is greater than the Temple. He is the Head of God’s spiritual Temple. He is its High Priest, and the disciples are His priests in training, His agents! Thus, their Sabbath ministry intensifies, even as Jesus’ does. Were they justified, then, in eating on the Sabbath? Absolutely! They were justified because of the circumstances and the offices they were now holding in God’s spiritual Temple!
So, the circumstances dictated a “profaning of the Sabbath” because of their involvement in the work of God. Loving service is greater than ritual fulfillment. What loving services were Jesus and His disciples performing on the Sabbath? They were teaching God’s way. They were healing people. Now, what is mercy? Mercy is doing helpful acts: acts of love, aid, comfort, pity, and sympathy for other’s distress. All these works help relieve a person of a burden.