The purpose of the Sabbath as a day of rest goes back as far as the book of Genesis and is a legal part of the Torah as one of the 10 Commandments. The Jewish Talmud specifies 39 categories of prohibition on the Sabbath, but in practice was and still is a matter of debate among various Jewish traditions. Jesus felt there are reasonable expectations based on basic human needs. Rabbis who would agree with him provided one avoids tools that would qualify the activity as work. This story then is one of those exceptions.
What makes this story interesting is that the Pharisees did not challange Jesus but were going to get together later and discuss how they would go after him for some kind of Jewish violation. Jesus could have waited until sundown. Significantly the healing did not involve any "melakhot" or physical effort. Jesus simply spoke, and did not touch the man or perform any physical act, and the hand was healed. This story is repeated with slight variations in Mark 3: 1-7 and Luke 6: 6-11