I will get to my answer to that question in a little while, but first let me share the passage I read about in Luther's commentary, and his summary of its basic meaning (which I think is right on). Galatians 4:21-31 says,
"Tell me, you who desire to be under the law, do you not listen to the law? For it is written that Abraham had two sons, one by a slave woman and one by a free woman. But the son of the slave was born according to the flesh, while the son of the free woman was born through promise. Now this may be interpreted allegorically: these women are two covenants. One is from Mount Sinai, bearing children for slavery; she is Hagar. Now Hagar is Mount Sinai in Arabia; she corresponds to the present Jerusalem, for she is in slavery with her children. But the Jerusalem above is free, and she is our mother. For it is written, 'Rejoice, O barren one who does not bear; break forth and cry aloud, you who are not in labor! For the children of the desolate one will be more than those of the one who has a husband.' Now you, brothers, like Isaac, are children of promise. But just as at that time he who was born according to the flesh persecuted him who was born according to the Spirit, so also it is now. But what does the Scripture say? “Cast out the slave woman and her son, for the son of the slave woman shall not inherit with the son of the free woman.” So, brothers, we are not children of the slave but of the free woman."
Luther writes this about the overall point of that passage:
Paul quotes the allegorical prophecy of Isaiah to the effect that the mother of many children must die desolately, while the barren woman shall have an abundance of children. (Isaiah 54:1.) He applies this prophecy to Hagar and Sarah, to the Law and the Gospel. The Law as the husband of the fruitful woman procreates many children. For men of all ages have had the idea that they are right when they follow after the Law and outwardly perform its requirements.
Although the Law has many children, they are not free. They are slaves. As servants they cannot have a share in the inheritance, but are driven from the house as Ishmael was cast out of the house of Abraham. In fact the servants of the Law are even now barred from the kingdom of light and liberty, for "he that believeth not, is condemned already." (John 3:18.) As the servants of the Law they remain under the curse of the Law, under sin and death, under the power of the devil, and under the wrath and judgment of God.
On the other hand, Sarah, the free Church, seems barren. The Gospel of the Cross which the Church proclaims does not have the appeal that the Law has for men, and therefore it does not find many adherents. The Church does not look prosperous. Unbelievers have always predicted the death of the Church. The Jews were quite certain that the Church would not long endure. They said to Paul: "As concerning this sect, we know that everywhere it is spoken against." (Acts 28:22.) No matter how barren and forsaken, how weak and desolate the Church may seem, she alone is really fruitful before God. By the Gospel she procreates an infinite number of children that are free heirs of everlasting life.
So far so good, and as usual Luther gets the main point about justification right. But then he goes on to say some things that raise the question of whether he was an antinomian. The answer is... yes and no. But no more than yes. Let me explain...
The term "antinomian" comes from Greek words meaning "against law." In a sense Luther is against law, and some critics (but not most scholars who know history) might apply the term to Luther because he makes statements like these:
The scholastics think that the judicial and ceremonial laws of Moses were abolished by the coming of Christ, but not the moral law. They are blind. When Paul declares that we are delivered from the curse of the Law he means the whole Law, particularly the moral law which more than the other laws accuses, curses, and condemns the conscience. The Ten Commandments have no right to condemn that conscience in which Jesus dwells, for Jesus has taken from the Ten Commandments the right and power to curse us.
Paul, however, refers particularly to the abolition of the moral law. If faith alone in Christ justifies, then the whole Law is abolished without exception.
Luther is "against law" in the sense that obedience to it should never be considered as a basis of our justification before God. But the most common historical meaning of antinomianism is that after justification believers are not required to obey God's law, and that it should not be taught to them or pressed upon their conscience in any way. In that sense Luther is not an antinomian, as these further quotes from his commentary demonstrate:
Isaiah [in the OT passage Paul quotes] calls the Church barren because her children are born without effort by the Word of faith through the Spirit of God. It is a matter of birth, not of exertion. The believer too works, but not in an effort to become a son and an heir of God. He is that before he goes to work. He is born a son and an heir. He works for the glory of God and the welfare of his fellowmen.
St. Bernard was one of the best of the medieval saints. He lived a chaste and holy life. But when it came to dying he did not trust in his chaste life for salvation. He prayed: "I have lived a wicked life. But Thou, Lord Jesus, hast a heaven to give unto me. First, because Thou art the Son of God. Secondly, because Thou hast purchased heaven for me by Thy suffering and death. Thou givest heaven to me, not because I earned it, but because Thou hast earned it for me." If any of the Romanists are saved it is because they forget their good deeds and merits and feel like Paul: "Not having mine own righteousness which is of the law, but that which is through the faith of Christ." (Phil. 3:9.)
When we understand the context of the first couple quotes, which may seem antinomian in flavor, we see that Luther was referring to the relationship of the law to justification rather than to sanctification. And we know from his other writings that he taught the Ten Commandments and other aspects of the moral law to the Christians under his care, and in fact he believed that even non-Christians needed to hear it in order to be convicted of their sins and "flee to Christ for salvation" (see this post about that). Also, believe it or not, he was actually the person who coined the term "antinomians" during his debates with some real ones among his followers, who said that the law should not even be taught in the churches.
So Luther could not rightly be called an antinomian himself, but he is not without blame for the excesses of those followers (just like he is not without blame for later German antisemitism), because of some of the language he used (like in the quotes above). Interestingly, the final complete edition of his Galatians commentary was published in 1535, which was a few years prior to the rise of the real antimonians in the Lutheran Church. (In Luther's preface to that edition, he names his foils as the Papists and the Anabaptists, but doesn't mention any antinomians.) It wouldn't be a stretch to surmise that the immoderate statements in Luther's teaching about the law were used by the devil to promote the really bad ideas that came later.
That's a practical "takeaway" from this discussion: Careless errors of wording, especially by great men of God, become heresy later among their followers. Even so we should all be careful with our words and lives, because "where parents walk their children will run" and other such sayings are cliches for a reason.