Let us run through this exceedingly devout psalm in a moral sense.
1. O God, the heathen (that is, vices and evil thoughts) have come into Thy inheritance (that is, into my soul and flesh, which were sanctified to Thee, so that Thou mightest dwell in this possession, after sins had been driven out from there). They have defiled Thy holy temple (that is, soul and body, for our members are the temple of the Holy Spirit). This prayer vehemently moves and challenges and affects the Hearer, the Lord. “For this is not my hurt, though it is my loss, but Thine, for it is Thy inheritance and Thy temple. And this should indeed challenge Thee, that those evils do not stay in their own place but rise up to Thine, which cannot be compared with them. What hath light to do with darkness? (2 Cor. 6:14). Therefore the dignity of the place and the indignity of those who defile it should move Thee. They are heathen, idolaters, slaves of demons, but Thy place is the inheritance and holy temple. Here, however, one must put on an attitude of hating and disparaging sin and of magnifying the grace and worth of the soul. Second, it should move Thee, because it is Thy inheritance, which Thou hast obtained at such great cost, with the accomplishment of such great miracles. It is not moving in on Thy spoils or riches, but on the very chief inheritance itself, in which Thy death, cross, and blood are sealed.” But behold, in these short words the Lord is reminded of the same thing that others say in explicit words: “Lord Jesus Christ, be mindful of Thy death and Thy blood poured out for me.” And all other extreme and most vehement supplications are included here, if the words are properly broken up and chewed or pondered. How can you beseech the Lord in a more exalted way than if you call His inheritance to His attention? Having heard this one word, He will immediately remember how much He suffered for it and how much it cost Him. Third, it ought to advise Him that they have not simply passed through but have defiled the inheritance. The Gentiles cannot do otherwise. For by their very entrance they defile it, since they are defilement itself, namely, vices and evils. Thus the Gentiles were literally forbidden to enter the sanctuary. Mystically this means that vices are forbidden to enter the soul. Because this mystery is not observed, empty letters, that is, earthly temples, are frequently struck by lightning. So then, if we have sinned and vices have come in, let us learn no longer to keep silent nor delay being converted to the Lord, but let us quickly accuse them before the Lord so that He may take vengeance on them and drive them from our midst.
Luther’s works, vol. 11: First Lectures 2