To add to the previous answers:
The Sabbath
God was very, very serious about His command in Exodus 31:13-17 (and others). Violators were to suffer the death penalty! So, what is the Sabbath?
There are two key words in the commandment:
• The word, Holy, is qodesh (SH 6944), which means set apart, dedicated.
• The word, work, is melakah (SH 4399), which means occupation, work
A lot depends on the definition of work. Notice the deliberate parallelism in the commandment to God’s creation and our seven-day week! We are, after all, made in the image of God, including God’s creativity on a tiny scale. A question that might be considered is whether our keeping of the Sabbath is in respect and reverence to God’s six days of creation and the day of rest on the seventh.
Also notice that no specific examples or explanations were included in the command–unlike the tenth commandment, about not coveting. I believe this omission was also deliberate to discourage legalistic application, which was done anyway. All 613 commands of Torah were contentiously expanded to thousands of laws, including “fences” around each law to prevent accidental infringement. For example, is it okay to wear dentures on the Sabbath or turn on a light switch? The answer to both cases is they are absolutely not permitted. Don’t believe me?
“In summary, all permanent bridgework, or cemented or wired (i.e.,
permanent) braces do not constitute an interposing barrier
(chatzitzah) and therefore do not hinder the regular process of
tevilah. However, removable dentures, removable braces, removable bridges and the like must be removed before tevilah. The application
of a surgical dressing to the gums during extensive gum work may
require a delay in the time of tevilah. Rabbinic consultation should
be sought in such cases as each case must be adjudicated based upon
the particular circumstances of that case.” – from jlaw.com
Now, imagine the mental state and attitudes resulting from successfully and strictly complying with all these laws. Did you know that the Essenes prohibited the work of defecation on the Sabbath? Remember, the specified penalty for violation was death!
Several Responses from Jesus
Then Pharisees and scribes came to Jesus from Jerusalem and said, “Why
do your disciples break the tradition of the elders? For they do not
wash their hands when they eat.” He answered them, “And why do you
break the commandment of God for the sake of your tradition?
You hypocrites! Well did Isaiah prophesy of you, when he said: “‘This
people honors me with their lips, but their heart is far from me; in
vain do they worship me, teaching as doctrines the commandments of
men.’”
But what comes out of the mouth proceeds from the heart, and this
defiles a person. For out of the heart come evil thoughts, murder,
adultery, sexual immorality, theft, false witness, slander. These are
what defile a person. But to eat with unwashed hands does not defile
anyone.” – Matthew 15:1-3, 7-9, 18-20 ESV
“Do not think that I have come to abolish the Law or the Prophets; I
have not come to abolish them but to fulfill them. For truly, I say to
you, until heaven and earth pass away, not an iota, not a dot, will
pass from the Law until all is accomplished. – Matthew 5:17,18 ESV
“You have heard that it was said, ‘You shall not commit adultery.’ But
I say to you that everyone who looks at a woman with lustful intent
has already committed adultery with her in his heart.” – Matthew
5:27,28 ESV
“For I tell you, unless your righteousness exceeds that of the scribes
and Pharisees, you will never enter the kingdom of heaven.” – Matthew
5:10 ESV
Ouch! Jesus is implying that the strict observance of Torah by the scribes and Pharisees was not adequate in God’s sight!
Conclusion
"Doing good" on the Sabbath was not included in Exodus because God’s stated intent was to set the Sabbath apart from the other days for us to rest from the work we perform every other day to produce something of value. God called the seventh day a day of “rest” in remembrance of His day of rest. We can see by example that during the exodus from Egypt, God instructed the people not to do the work of gathering and cooking food on the Sabbath, but to save up enough manna on the sixth day to last through the seventh day.
Then the Lord said to Moses, “Behold, I am about to rain bread from
heaven for you, and the people shall go out and gather a day's portion
every day, that I may test them, whether they will walk in my law or
not. On the sixth day, when they prepare what they bring in, it will
be twice as much as they gather daily.” – Exodus 16:4,5
He [Moses] said to them, “This is what the Lord has commanded:
‘Tomorrow is a day of solemn rest, a holy Sabbath to the Lord;
bake what you will bake and boil what you will boil, and all that is
left over lay aside to be kept till the morning.’ – Exodus 16:23 ESV
To reconcile these assertions by Jesus leads us to conclude that we cannot achieve justification by means of Torah, but rather by trusting in God to provide our justification by means of the work of Jesus.
Let me also note that the role of Torah in the lives of Gentile believers was the subject of significant controversy in the early church, culminating a letter from the apostles and elders to the church at Antioch found in Acts 15:23-29. The role of good works as the fruit of our transformed lives is affirmed in several places in the New Testament, not the least of which is in the letter from James.