The following is from the web page Luther, Exposing the Myth, under the heading "On the Person of Christ":
“It does not matter how Christ behaved – what He taught is all that matters”[Erlangen Vol. 29, Pg. 126].
Luther Exposing the Myth says their stated purpose is to show that "from Luther’s own words we shall see him for what he really was, that is a rebellious apostate, who abandoned the faith and led many into apostasy from God under the guise of “reformation” in order to follow his perverse inclinations." With this quote, they attempt to show Christ lived a moral life without sin, while Luther says the type of life Christ lived doesn't matter.
Luther, Exposing the Myth cites "Erlangen Vol. 29, Pg. 126." "Erlangen" refers to Dr. M. Luthers Samtliche Werke, an older set of Luther's works from the nineteenth century. There is no such comment from Luther "It does not matter how Christ behaved – what He taught is all that matters" on Page 126 of Erl. 29. Luther, Exposing the Myth probably lifted this quote from Peter Wiener's Martin Luther, Hitler's Spiritual Ancestor and botched the reference. Quoting Luther on page 30, Wiener states,
"It does not matter what people do; it only matters what they believe." "God does not need our actions. All He wants is that we pray to Him and thank Him." Even the example of Christ Himself means nothing to him. "It does not matter how Christ behaved—what He taught is all that matters" (E29, 196), is Luther's subtle distinction.Page 195 is the correct reference in Erl. 29. The sentence Wiener cites is from the following paragraph at the bottom of page 195:
The quote comes from the treatise Wider die himmlischen Propheten, von den Bildern und Sakramen. This text can be found in WA 18:62-214 with the quote in question found on page 117. The text has been translated into English: Against the Heavenly Prophets in the Matter of Images and Sacraments (1525) found in LW 40: 71-222 with the question being found on page 134.
This treatise was written primarily against Luther's former colleague, Andreas Bodenstein von Karlstadt. In the section where this obscure quote occurs, Luther was evaluating Karlstadt's argument against the elevation of the sacrament. The editors of LW explain, "Karlstadt is unable to cite a prohibition of Christ with respect to elevation of the sacrament. He must content himself to point out that Christ has not commanded it" [LW 40:134 n, 85]. Karlsadt's argues that since Christ never elevated the sacrament, then neither should the church. Luther responds:
At this point you should carefully examine Dr. Karlstadt’s spirit, noting the way he proceeds, how he would tear us from the Word and lead us toward works. To achieve this all the better, and to make a good impression, he holds before you the works of Christ himself, so that you might thereby be alarmed and think: Oh, really, who should not follow Christ? And yet all the while he conceals the Word. For he has none to which he can point. For after he has seen how we will pay no attention to human words and works, be they ever so holy or ancient, etc., and would have Christ alone as our master, the rogue divides Christ into two parts. Namely, how Christ, on the one hand, without words does and refrains from doing certain works, and, on the other hand, how with words he does and refrains from doing works. Dr. Karlstadt is so knavish that he presents Christ alone as he does and refrains from doing without words, wherein he is not to be followed by us, and is silent where Christ does and refrains from doing with words, wherein we are to follow him.
Do you see here the devil, who before has misled us through saints? He would now mislead us through Christ himself. Beware where you do not hear God’s word commanding or forbidding you so that you may not be led astray and pay no attention to it, even if Christ himself did it. Has not enough been said? We read: “Thy word is a lamp to my feet” (Ps. 119[:105]). The Word, the Word is to be followed, don’t you hear? When one now holds before you how Christ has done it, speak up briskly: Very well, he has done it. Has he also taught and commanded it to be done? Also if one holds before you, this Christ has not done, then speak up briskly: Has he also forbidden it? And if they cannot point to his Word, then say: Put it aside, let it be. That doesn’t apply to me. Nor is it an example, it is his work, done for his own part. If they say: All of Christ’s doing is for our instruction, let them say it. But note carefully what is meant with instruction. A man has said it. He has as much authority as you yourself.
So it is in the world, as the saying goes: He who cannot sing always wants to sing, whoever cannot preach or write, he wants to preach and write. But whoever can, he hesitates and does so reluctantly. Dr. Karlstadt, who hereby proves that he doesn’t understand Christ at all, just as above he doesn’t understand Moses, must preach and write when no one has commanded or requested him to do so, and when he is requested to do so, he does not do it. He interprets Moses in such a way that the disorderly populace is incited to punish public misdeed. However, Dr. Karlstadt does not and cannot teach Moses spiritually, as he reveals sin and physically drives rough and rude people to works. He constructs his own Moses. Thus here he also constructs his own Christ, that we are to follow his works without the Word. But he does not understand how Christ is first of all our salvation, and thereafter his works with the Word are our example. He knows no more about the New Testament than he does about the Old, and yet he would write about the sacrament and such matters, as though there were great need for his absurd and blind art, and; indeed, his folly [LW 40: 134].
Wiener's quote "It does not matter how Christ behaved – what He taught is all that matters" appears to be a summary statement of this section of text. In this section, Luther is arguing that the spoken words of Christ set the standard and defines doctrine, over against Karlstadt's notion that what Christ did or didn't do (without words) also serve to set the standard and defines doctrine. Luther says in the same treatise, "If the rule is to be that one is so strictly to follow the example of Christ and not the Word alone, then it will follow that we should observe the Last Supper nowhere but in Jerusalem, in the upper room" (LW 40:132).
The summary quote from Wiener though gives quite another impression, and Roman Catholics, perhaps taking it at face value, see yet again a caricature that Luther didn't take holy living seriously (especially when Wiener prefaces the comment stating, "the example of Christ Himself means nothing to him"). The irony of course is that in context Luther is actually arguing for something (the elevation of the mass) that Roman Catholics actually practice. This is an excellent example of completely ignoring a context.
Luther was concerned with "how Christ behaved" and following the example of Christ. In the very same treatise Luther states,
No one can mortify the flesh, bear the cross, and follow the example of Christ before he is a Christian and has Christ through faith in his heart as an eternal treasure. You don’t put the old nature to death, as these prophets [Karlstadt] do, through works, but through the hearing of the gospel. Before all other works and acts you hear the Word of God, through which the Spirit convinces the world of its sin (John 16[:8]). When we acknowledge our sin, we hear of the grace of Christ. In this Word the Spirit comes and gives faith where and to whom he wills. Then you proceed to the mortification and the cross and the works of love. [LW 40:149].