“Faith alone is necessary for justification. All other things are completely optional, being no longer commanded or forbidden.”
 Luther’s Commentary on Galatians 2
The intent appears to be to show that works are optional in Luther's theology and that God's commandments given to Moses are no longer to be enforced. A Christian can live however they want to, because they are saved by faith alone. Moses and the law are over. If this was Luther's actual position, it would be shocking... but it isn't Luther's position.
The article cites"Luther’s Commentary on Galatians 2." The actual source was probably Patrick O'Hare's The Facts About Luther. O'Hare states,
In this declaration of false security, we have the beginning of Luther's new gospel, which, needless to say, is directly and openly opposed to the Gospel of Jesus Christ. As a theologian, he should have realized that his notion of the absolute assurance of salvation imparted by Faith was as false as it was unsound, and as a professor of Scripture, he should have known that faith alone is barren and lifeless apart from the meritorious works which are necessarily connected with and founded on it. To hold and declare that men are justified by faith to the entire exclusion of other Divine virtues is nothing less than a perversion of the Bible, a falsification of the Word of God, and an injury to souls called to work out their salvation along the lines plainly designated by Jesus Christ. But Luther's self esteem and self-conceit blinded him to the truth he once held in honor, and, instead of repelling and mastering his singular conception of salvation, as he was in duty bound to do, he held to it with unbending tenacity, developing it more and more until he finally declares in Cap. 2, ad. Gal. that "Faith alone is necessary for justification: all other things are completely optional being no longer either commanded or forbidden." It is this doctrine which he afterwards called the Articulus stantis vel cadentis Ecclesiae; and if we cannot quite accept this description of it, at least we can recognize that it is the corner-stone of the Lutheran and Calvinistic systems.Forms of this quote made the rounds previous to O'Hare (often cited by Rome's defenders). This 1857 Roman source states, "That a man is justified by faith alone, is a doctrine started by Martin Luther : 'Faith alone (he says) is necessary for our justification; all other things are completely optional, being no longer either commanded or forbidden.' ['Sola fides necessaria est ut justi simus; caetera omnia liberrima, neque praecepta amplius, neque phohibita' In Cap. 2, ad Gal.]." This source actually moves the quote's polemical use back to Robert Bellarmine (1542-1621) and is cited as "Faith alone is necessary that we may be justified; all things else are quite free, being neither enjoined nor prohibited us." This same source adds, "I do not find these words in Luther, but I find what manifestly establishes his opinion and proves Bellarmine to be a calumniator." However faulty Bellarmine's interpretation may have been (I could not locate it), he wasn't mistaken that these words were from Luther:
Probably why the author above couldn't find Bellarmine's Luther reference is because there are five or six versions of the Galatians commentary (LW 27:ix). The quote in question is from his 1519 work on Galatians. This particular quote can be found in WA 2:485 and translated into English in LW 27:213.
The context involves Luther's comments on Galatians 2:11-13 in which Paul confronts Peter:
11. But when Cephas came to Antioch, I opposed him to his face, because he stood condemned. 12. For before certain men came from James, he ate with the Gentiles; but when they came, he drew back and separated himself, fearing the circumcision party. 13. And with him the rest of the Jews acted insincerely, so that even Barnabas was carried away by their insincerity.Luther first explains the disagreement between Jerome and Augustine on interpreting this text. The basic problem as Luther understood it is that Paul was charging Peter with forcing Gentiles to live like Jews as a necessary element of the Christian faith. He states:
Thus Paul’s complaint is not that the rest of the Jews concurred with respect to food, whether Gentile or Jewish (for they knew that this was permitted), but that they concurred in Peter’s hypocrisy and in his forcing of Gentiles and Jews into Judaism as something that was necessary. Nor does he complain that Barnabas ate with them in Jewish or in Gentile fashion, but that he was misled into the same hypocrisy and concurred in forcing Gentiles and Jews into Judaism.
Therefore Paul is fighting against compulsion and on behalf of freedom. For faith in Christ is all that is necessary for our righteousness. Everything else is entirely without restriction and is no longer either commanded or forbidden. Consequently, if Peter had observed both customs in the proper spirit, as Paul boldly observed both customs, it would not have been necessary to censure him.
Luther, M. (1999). Luther’s works, vol. 27: Lectures on Galatians, 1535, Chapters 5-6; 1519, Chapters 1-6. (J. J. Pelikan, H. C. Oswald, and H. T. Lehmann, Eds.) (Vol. 27, p. 213). Saint Louis: Concordia Publishing House.Conclusion
The context of Luther's remarks involve forcing Gentiles to live as Jews. The "everything else" in this context is in respect to the customs of the Jews as necessary for the Christian faith. Luther actually saw no problem with Peter eating with either the Jews or gentiles:
Paul reproved Peter because he acted in a hypocritical manner. It was Peter’s hypocrisy, I say, that Paul did not stand for. He approves of what Peter had done by living as the Gentiles lived and again by living as the Jews lived. But he censures him for withdrawing and segregating himself from the foods of the Gentiles when the Jews came; for by this withdrawal Peter caused the Jews to believe that the ways of the Gentiles were forbidden and that the ways of the Jews were necessary, even though he knew that the ways of both were unrestricted and permissible. Luther, M. (1999). Luther’s works, vol. 27: Lectures on Galatians, 1535, Chapters 5-6; 1519, Chapters 1-6. (J. J. Pelikan, H. C. Oswald, and H. T. Lehmann, Eds.) (Vol. 27, p. 213). Saint Louis: Concordia Publishing House.Luther states also:
This I know, that those who were being forced into Judaism by such hypocrisy would have perished had they not been brought back through Paul; for they began to look for justification in the works of the Law, not in faith in Christ. Consequently, Peter, together with the others, gave powerful offense—not in the matter of morals but in the matter of faith, involving eternal damnation. And Paul would not have opposed him so confidently either if there had been a slight and pardonable danger here. But failure to follow the truth of the Gospel is already the sin of unbelief. Luther, M. (1999). Luther’s works, vol. 27: Lectures on Galatians, 1535, Chapters 5-6; 1519, Chapters 1-6. (J. J. Pelikan, H. C. Oswald, and H. T. Lehmann, Eds.) (Vol. 27, p. 214). Saint Louis: Concordia Publishing House.Even in the very context of this 1519 Galatians commentary, Luther goes on to say that there is a place for works. note his comments in regard to Galatians 2:16:
Nevertheless, it should be noted here that the apostle does not reject the works of the Law as Jerome also points out in this connection. He rejects reliance on the works of the Law. That is, he does not deny that there are works, but he does deny that anyone can be justified through them. Therefore one must read the apostle’s statement with emphasis and close attention when he says: “A man is not justified on the basis of the works of the Law”; as if he were saying: “I grant that works of the Law are done; but I say that a man is not justified because of them—except in his own sight and before men, and as a reward in this life. Let there be works of the Law, provided that one knows that in the sight of God they are sins and no longer true works of the Law.” In this way he totally demolishes reliance on our own righteousness, because there is need of a far different righteousness—a righteousness beyond all works of the Law, namely, a righteousness of the works of God and His grace.
Furthermore, you must also observe that Paul speaks of “works of the Law” in general not merely of those that relate to the Ceremonial Law but certainly also of all the works of the Decalog. For these, too, when done apart from faith and the true righteousness of God, are not only insufficient; but in their outward appearance they even give hypocrites false confidence. Therefore he who wants to be saved must despair altogether of all strength, works, and laws. [Luther, M. (1999). Luther’s works, vol. 27: Lectures on Galatians, 1535, Chapters 5-6; 1519, Chapters 1-6. (J. J. Pelikan, H. C. Oswald, and H. T. Lehmann, Eds.) (Vol. 27, pp. 222–223). Saint Louis: Concordia Publishing House].
The apostle’s rule is this: It is not works that fulfill the Law, but the fulfillment of the Law produces works. One does not become righteous by doing righteous deeds. No, one does righteous deeds after becoming righteous. Righteousness and fulfillment of the Law come first, before the works are done, because the latter flow out of the former. That is why Paul calls them “works of the Law” in distinction from works of grace or works of God; for works of the Law are really the Law’s, not ours, since they are done, not by the operation of our will but because the Law extorts them through threats or elicits them through promises. But whatever is not done freely of our own will but is done under the compulsion of another is no longer our work. No, it is the work of him who requires it. For works belong to him at whose command they are done. But they are done at the command of the Law, not at the pleasure of one’s own will. It is clear enough that if a person were free to live without the Law, he would never do the works of the Law of his own accord. Hence the Law is called an enforcer when in Is. 9:4 it is spoken of as “the staff for his shoulder, the yoke of his burden, the rod of his oppressor, as on the day of Midian.” For through the Child who was given to us (Is. 9:6) and in whom we believe we become free and take pleasure in the Law; and we no longer belong to the Law, but the Law belongs to us. And our works are not works of the Law; they are works of grace, from which there spring up freely and pleasantly those deeds which formerly the Law used to squeeze out with harshness and power. [Luther, M. (1999). Luther’s works, vol. 27: Lectures on Galatians, 1535, Chapters 5-6; 1519, Chapters 1-6. (J. J. Pelikan, H. C. Oswald, and H. T. Lehmann, Eds.) (Vol. 27, pp. 223–224). Saint Louis: Concordia Publishing House].That "Luther wasn't a fan of Moses' commandments" as the Shocking Beliefs of Martin Luther asserts cannot be justified, at all, from the context of this quote. The quote being used was lifted out of its context (originally by O'Hare?) and put in the mouth of an antinomian Luther, a caricature, a "shocking" caricature.
This final Luther comment, from the same text, should be enough to prove that the quote in context isn't at all shocking to someone familiar with historic Protestant theology:
When faith has been born, you see, its task is to drive what is left of sin out of the flesh. It does so by means of various afflictions, hardships, and mortifications of the flesh, so that in this way the Law of God gives pleasure and is fulfilled not only in the spirit and in the heart but also in the flesh that still resists faith and the spirit which loves and fulfills the Law, as is beautifully described in Rom. 7:22f. [Luther, M. (1999). Luther’s works, vol. 27: Lectures on Galatians, 1535, Chapters 5-6; 1519, Chapters 1-6. (J. J. Pelikan, H. C. Oswald, and H. T. Lehmann, Eds.) (Vol. 27, p. 231). Saint Louis: Concordia Publishing House].