One sabbath while Jesus was going through the grainfields, his disciples plucked some heads of grain, rubbed them in their hands, and ate them. But some of the Pharisees said, “Why are you doing what is not lawful on the sabbath?”
Jesus answered, “Have you not read what David did when he and his companions were hungry? He entered the house of God and took and ate the bread of the Presence, which it is not lawful for any but the priests to eat, and gave some to his companions?” Then he said to them, “The Son of Man is lord of the sabbath.”
I’ll be honest, I really don’t understand Jesus’ logic here. Yes, I get that Jesus is referencing this David story to simply say that there is precedent for eating food (even holy food) on the Sabbath. But if that’s the case, his logic is this: “You don’t like what I’m doing? Well, based on a very simplistic reading of the Bible, someone else did it, therefore I can do it.”
He does know that David also did the whole adultery and murder thing with Bathsheeba, right? Just because someone else did it, doesn’t explain why you have the right to do it. Secondly, after saying saying all this, he goes ahead and says that it doesn’t even matter anyway because he is “lord of the Sabbath”.
So, in the end, it seems to me like Jesus is just trying to be snarky here.