"When the Son of Man comes in His glory, and all the holy angels with Him, then He will sit on the throne of His glory. All the nations will be gathered before Him, and He will separate them one from another, as a shepherd divides his sheep from the goats. And He will set the sheep on His right hand, but the goats on the left. Then the King will say to those on His right hand, 'Come, you blessed of My Father, inherit the kingdom prepared for you from the foundation of the world: for I was hungry and you gave Me food; I was thirsty and you gave Me drink; I was a stranger and you took Me in; I was naked and you clothed Me; I was sick and you visited Me; I was in prison and you came to Me.' Then the righteous will answer Him, saying, 'Lord, when did we see You hungry and feed You, or thirsty and give You drink? When did we see You a stranger and take you in, or naked and clothe You? Or when did we see You sick, or in prison, and come to You?' And the King will answer and say to them, 'Assuredly, I say to you, inasmuch as you did it to one of the least of these my brethren, you did it to Me'" (Matt. 25:31-40).
"When the Son of Man comes in His glory" - Jesus has been reigning at the right hand of God since Pentecost (cf. Acts 2:33; I Cor. 15:25). However, when He comes a second time, He will judge the world (cf. Acts 17:31) on "the throne of His glory." It will be on that day that His glory will be most clearly demonstrated to all men through His decisions of mercy, justice, and righteousness.
Everyone will be gathered before Him, both the righteous and the unrighteous (cf. John 5:28,29; Acts 24:15). It is not the nations that will be separated, but the individuals that compose them. Contextually, it is almost certain that Jesus had His disciples in mind in this discourse; however, the principles He teaches here are certainly applicable to all people.
It was customary for the shepherd to let the sheep and goats feed together during the day, but he would separate them at night. Goats are here used to represent those who are unrighteous and unfaithful. This is likely the case because goats have to be driven, while sheep, on the other hand, voluntarily follow the shepherd.
"And He will set the sheep on His right hand, but the goats on the left" - The Hebrew people always viewed the "right hand" as the preferred place, the place of honor (e.g., Gen. 48:13ff). It should be noted that there is no middle ground; all are either on the right or the left!
"Come, you blessed of My Father, inherit the kingdom prepared for you from the foundation of the world" - On that glorious day, Jesus will beckon the faithful to take possession of that which is theirs as rightful heirs (i.e., the kingdom of heaven and eternal life). From before the beginning, God had made plans for such a kingdom, and it appears to have been in the process of preparation ever since (cf. John 14:2).
The physical needs being met here are the most basic of life: (1) Food, (2) Drink, and (3) Shelter (cf. Matt. 25:35). Certainly all of the needs under consideration here are legitimate ones. One who is able to work but simply not willing (cf. II Thess. 3:10) is not one who should be helped with life's necessities.
The needs mentioned in Matthew 25:36 are also basics of life: (4) Clothing, and (5) Kindness and Compassion (e.g., visiting the sick and imprisoned). These acts of mercy do not represent single acts, but the habits of those with a living, loving faith.
The righteous ask when did they ever see Jesus in such a condition and help Him in the manner stated. It is doubtful that such dialogue will actually take place at the Judgment. The purpose of such here is to illustrate the fact that although one may simply consider himself to be helping a fellow human being, in actuality, he is serving Christ. That which we do to others who are made in God's image (cf. Gen. 1:26,27), is, for all practical purposes, that which we do to God Himself. Jesus plainly declares this truth in Matthew 25:40. The question of the righteous also suggests that their good works were not done to receive praise; they were simply following the example of their Master "who went about doing good" (Acts 10:38).
Certainly this passage does not contradict the rest of the New Testament; it does not teach that salvation can be earned by acts of compassion and good will. However, it does teach that none can be saved without these fruits of faith and love (cf. Gal. 5:6). Those who may be great students of the Bible will not be found among the faithful if they lack the fullness of Christian life manifested in the sacrifice of time, strength, and resources out of sympathy and love for those in need, specifically one's brethren (cf. Gal. 6:10).