Jesus is a rule breaker. He breaks the rules with purpose and intentionality. He breaks the rules because they rules themselves have become toxic. In the first century the religious people were not following the 10 commandments, they were following the traditions and "hedges" that rose up to protect the 10 commandments. The 4th commandment says "no work on the Sabbath". That seems pretty clear to most of us but the ancient Rabbi's believed it worth exploring further and so an interpretative layer was added to define "work". Some of these are obvious: plowing, cleaning, cooking, harvesting and the like were clearly work. Over the centuries layer upon layer of interpretation was piled onto the original commandment. Even though the man in John 5 had been healed of paralysis, the religious people are shouting at him for carrying his mat home.
This over reaction reveals legalism at its worse. Modern Churches fall into the same kinds of traps. When things have to be done in a certain way or when the style of worship becomes more important than the substance of worship we have fallen into this same trap. When the outward practice and appearance takes precedence over the inward transformation of the heart we are living in a legalistic situation.
Jesus, of course, does all this intentionally. It is his intent to break their sabbath understandings. It is his intent to show that as the "son of God" (see verses 17/18) he has the authority to challenge them. In the other Gospels Jesus calls himself "Lord of the Sabbath". Chapter 5 ends with an important message in John. The truth about Jesus and what Jesus came to do is already known by the religious people: it is spelled out in the books of Moses (verse 46).