A question was posed on a forum in MennoDiscuss about what the Bible says about legalism:
Biblically, that which we call legalism I think is discussed in the following ways:
a. Enforcing a law without regard to the needs of the other person. "I require mercy not sacrifice" Matthew 12
b. Insisting that one become a part of the law of Moses in order to be a follower of Jesus. This was the main discussion in the book of Galatians.
c. In matters not determined by Jesus, enforcing one's opinion or interpretation as legally binding. Romans 14
However, Biblical legalism is not a matter of not having a code to live by, because Jesus affirmed that we were not to murder, commit adultery, defraud, dishonor one's parents, etc. As well, he gave more laws such as to love one's enemies, to not be a hypocrite, to not judge, etc. There is a code for us to live by, and to say that all followers of Jesus obey Jesus is not legalism in a biblical sense.