Have you not read what David did when he and his men were hungry? He went into the House of God and ate the sacred bread, though neither he nor his men had a right to eat it, but only the priests. Matt. 12:3, 4, N.E.B.
Walking through grainfields on the Sabbath day may not have been considered inappropriate in Jesus' day, but picking and eating the grain as one went along certainly was. Pointing to the offending disciples, some Pharisees who had noticed what they were doing asked the Master why this forbidden activity was taking place. Jesus' answer must have shocked them. It might shock us, enlightened even as we are in the twentieth century.
He reminded them of the time that David and his men ate sacred bread from the Temple. In essence He gave them an example of an "unlawful" act as a precedent for His disciples' innocence. He added, " 'If you had known what that text means, "I require mercy, not sacrifice," you would not have condemned the innocent' " (Matt. 12:7, N.E.B.). The New English Bible translation of Hosea 6:6 reads "Loyalty is my desire, not sacrifice."
It might be easy to explain Christ's logic by making light of the Temple rules, except that as far as the sacred bread was concerned God made the rules! And Jesus came to fulfill the law, not to abolish it (chap. 5:17)! May I suggest that what the Master was trying to do was to get the Pharisees to look past the rules to the Rule Giver. The intent of the law is to draw us back to the Father. It was our "custodian until Christ came" (Gal. 3:24, R.S.V.), at which time the Father would be fully revealed. Sacrifices were offered because men continued to be misinformed about God, and consequently they behaved badly. "How much better," Christ was saying, "to know the Father well enough to be loyal in the first place!"
When David and his men ate the shewbread, David revealed that he understood that God's ultimate purpose in setting up the Temple services was to nourish Israel back into healthy relationship with their God. So secure was David in his knowledge of God that he did not hesitate to appropriate "God's bread" to alleviate his men's immediate need for physical nourishment.
David was righteous (in right relationship with God), though eating the sacred bread was technically unlawful. Think about it. Both God and His rules are for the sake of His people.