What was so shocking was that Jesus welcomed and refused to condemn the people whom the Pharisees despised as sinners to learn from him (Matthew 11:28-30). That did not mean they would remain immoral and ignorant of right and wrong. They were going to learn God's kind of love. But the change he encouraged was from the heart and based on freedom, rather than by trying to obey a string of rules. (John 8:31, 36), He also taught his disciples to trust the Holy Spirit to transform them from within (Luke 11:13, John 14:25-27, 15:26, 16:13).
Paul tells us he had been a Pharisee (Acts 23:6), and he claimed that according to their laws he had been blameless (Philippians 15:5,6). He had almost certainly been trained and worked as a rabbi, and he was certainly steeped in legalism. When Saul was converted, and became the Apostle Paul, he slowly learned and began to teach the freedom of the Spirit which he had learned from Jesus' disciples.
From Paul's letter to the Galatians it is clear that he had taught the Galatians that kind of freedom (Galatians 3:1-5, 5:1-6) But after he had moved on Pharisaic teachers had come in and "bewitched" the Galatian Christians back into legalism (Galatians 3:1). The "Galatian Heresy" was therefore a moving back into legalism from living and being transformed by the Spirit.
There is no question of living amorally or immorally (Galatians 5:13). Paul lists some works of the flesh, which are things we can easily do by our own effort (Galatians 5:19-21). Anybody can decide to be immoral, commit idolatry, make enemies, quarrel, be envious, get drunk. What we cannot do by any amount of trying is produce the fruit of the Spirit (Galatians 5:22-23). Christian Love, including fruits such as joy, peace, patience, generosity, can only be produced from within our heart by the Holy Spirit.
It is therefore clear that in his commentary on Galatians filled out
in the Epistle to the Romans (see the Commentary
on Romans) Paul has learned from Jesus' attack on Pharisaism (e.g.
Matthew 23). Instead of legalism, the good news is that we are free
to be transformed by the power of the Spirit (see Romans 8:4-11, 2 Corinthians
3:17-18).