Hans Dieter Betz argues that the origin of the Sermon on the Mount pre-dates the Gospel of Matthew; writes that it "belongs to early Jewish Christianity" in the mid-first century.
Hans Dieter Betz, “The Beatitudes of the Sermon on the Mount (Matt. 5:3–12): Observations on Their Literary Form and Theological Significance,” repr., Essays on the Sermon on the Mount (trans. L. L. Welborn; Minneapolis: Fortress Press, 1985), 17–36
Not only in the Christian church and in the consciousness of humankind in general, but in contemporary New Testament scholarship as well, Jesus’ so-called Sermon on the Mount (SM) remains a puzzling work. Characteristic of the older scholarship was the belief that the text of Matt. 5:3–7:27 derived directly from the historical Jesus and could thus be regarded as a source for his theology. But in recent research, this simple state of affairs is no longer taken for granted. It is certain that individual elements of the SM can be traced back to the historical Jesus; but it is equally uncertain by which methods one can obtain scientifically justifiable criteria for distinguishing between authentic sayings of Jesus and later additions. At present a redaction-historical approach is most often employed, according to which the evangelist Matthew himself compiled the SM out of the Q-traditions and his own compositions. In this way the Q-portions are brought into connection, directly or indirectly, with the historical Jesus, while everything that cannot be derived from Q is explained as the creation of the evangelist.
This consensus, which we have admittedly outlined in somewhat coarse fashion, is nevertheless burdened by a number of difficulties. For reasons of time, these difficulties can only be touched upon her in passing.
1. The Q-portions of the SM agree only approximately with their Lukan parallels, so that one must assume either that Matthew had another version of Q at his disposal, or that he himself modified the wording of Q down to the minutest details. But there remains a problem in that it is not possible to explain all of these modification on philological grounds or on the basis of the theology of Matthew.
2. The origin of the material that goes beyond Q remains a problem. It is hardly possible to designate all of this material as the creation of Matthew.
3. As soon as the SM is regarded as the composition of Matthew himself, one is prevented from seeing that the text is quite artistically structured and composed in itself. Yet formal analyses indicates that the SM is a unified, integrated complex.
4. A one-sided, redaction-historical interpretation prevents one from recognizing that the SM contains a theology that is independent of Matthew and different at characteristic points.
Largely for these reasons, I developed the hypothesis that the Matthean SM is a source that has been transmitted intact and integrated by the evangelist into the composition of his Gospel. But this source does not simply derive from the historical Jesus, in the sense that Jesus is the author of all the sayings in their present form and context. Rather, the SM represents a pre-Matthean composition of a redactional nature. Thus the methods of form and redaction criticism are to be further employed; it is only that they should not be applied to the Gospel as a whole, but merely the section Matt. 5:3–7:27.
I. LOCATION
If one reflects upon the section Matt. 5:3–7:27 apart from its context, it may be compared to a precious jewel that has a long and eventful history behind it and has only lately been fitted into a suitable, but wholly different, setting—namely, the Gospel of Matthew. As is often the case with precious stones, the origin of the jewel lies in the mysterious darkness. It is clear that many hands have worked at cutting and polishing it. Depending upon the light, it shines with first one then another color. All of this gives it its special radiance and charming life that never fail to have an effect upon the observer, especially when it is freed from its secondary Matthean context.
From the point of view of the history of religions, the SM belongs to early Jewish Christianity, a product of the mid-first century, when the Jewish-Christian community was still part of Judaism. The Jewish Christians who stand behind the SM and who speak through it are conscious, however, of a strained relationship to their mother faith. Like many other Jewish movements of the period, they also desire to be the “true” Judaism.” They find themselves in conflict with the party of the scribes and Pharisees. But they also represent a challenge to the conventional religion of the time by their relentless critique. Yet non-Jews are viewed from a still-greater distance, and many passages warn against assimilation with them.
But the polemical stance of the SM is also determined by the fact that it has knowledge of Gentile Christianity and sets itself off from it. Here, obviously, lies one of the critical points that served to bring the document into being in the first place.