Let's take a closer look at the story of the "sheep and the goats" and address some permutations being bandied about by liberal scholarship and critics. What are these?
The first comes of the part which says, "And the King shall answer and say unto them, Verily I say unto you, Inasmuch as ye have done it unto one of the least of these my brethren, ye have done it unto me." (25:40) Modern ideas have demanded that the "brethren" in question consist of any poor or oppressed person, and given the interpretation that helping such as these is the ultra-qualifier which makes the heavenly grade.
The second is broader and related: If people are being judged by what they do for the brethren, isn't this salvation by works -- and what happens to salvation by faith? Does this mean our religious beliefs make no difference?
We answered this in part in our item on baptism and salvation, where we noted:
Under the Semitic Totality paradigm, thoughts that result in no action are vain. When Paul encourages believers to "work out your own salvation with fear and trembling," (Phil. 2:12) he is not telling us that we must do our part to be saved. We already possess that righteousness; what is needed is for us to come to terms with this and live consistently with it.
...[Note] the qualification of Romans 3:20: "by the deeds of the law there shall no flesh be justified in his sight." Romans 2:5-10 does mean that a person who persists in good deeds will be granted eternal life, but as Romans 3 goes on to show, that is irrelevant, because no one can live a life in accordance with the commandments of God, and completely faithful obedience is no more than a theoretical means of obtaining justification.
The passages in Matthew, then, show no more than that those who had faith actually lived it out, as we would expect. As Moo puts it: [Romans, 142]
It is a continual seeking after eternal rewards, accompanied by a persistent doing of what is good, that is the condition for a positive verdict at the judgment. Paul never denies the validity of this principle, but he goes on to show that no one meets the conditions necessary for this principle to become a reality.
It is obvious, then, that faith alone -- a living and real faith -- is all that can save, as is made clear by Ephesians 2:8-9: "For by grace are ye saved through faith; and that not of yourselves: it is the gift of God: Not of works, lest any man should boast."
With this in mind, let's answer the two questions at issue:
Who are the "brethren"? The poor, the sick? No --
Matthew 12:48 But he answered and said unto him that told him, Who is my mother? and who are my brethren? And he stretched forth his hand toward his disciples, and said, Behold my mother and my brethren! For whosoever shall do the will of my Father which is in heaven, the same is my brother, and sister, and mother.
The poor, the sick, and so on is not a group in a one to one identity with those who do God's will. Who are those who do God's will? In the above, it is clearly the disciples of Jesus. Matthew 25:31-46 is all about judgment based on how one treated the disciples of Christ.
The passage needs to be read in light of these earlier ones:
Matthew 10:14-15 And whosoever shall not receive you, nor hear your words, when ye depart out of that house or city, shake off the dust of your feet. Verily I say unto you, It shall be more tolerable for the land of Sodom and Gomorrha in the day of judgment, than for that city.
Matthew 10:40-42 He that receiveth you receiveth me, and he that receiveth me receiveth him that sent me. He that receiveth a prophet in the name of a prophet shall receive a prophet's reward; and he that receiveth a righteous man in the name of a righteous man shall receive a righteous man's reward. And whosoever shall give to drink unto one of these little ones a cup of cold water only in the name of a disciple, verily I say unto you, he shall in no wise lose his reward.
A disciple traveling to and fro with the word in the ancient world is very likely to be in the condition of those described in 25:31-46 -- sick, poorly clothed, and as Jesus predicts, in prison.
What about the atheist who treats Christians nicely? Does he get to heaven, according to this?
If this passage were taken in strict isolation, and meant to be taken that way, and written in the context of an individualist society like ours, one might have a case for that odd individual getting a golden ticket, but it's not so simple.
The parable of the sheep and the goats draws upon a certain paradigm found within Judaism of Jesus' day [Keener, Matthew commentary, 603f], which held that the nations (cf. 25:32) would be judged based upon how they treated Israel (4 Ezra 7:37), and the related concept encouraging repressed minorities that God will judge the world based on their treatment of them. In holding this it was never assumed that this was the sole and exclusive basis for judgment. The specific matter of treatment of Israel was isolated to make a point of its importance in context (and here, the context is the end of the age of the law and the beginning of the age of the Messiah -- when the Gospel message would be brought to the Gentile world as a whole).
Moreover, the identification of Jesus with the disciples draws us even closer to the "faith" position. One's response to the disciple is the same as one's response to Jesus, and in a collectivist society, one would not assist a member of a divergent party in the way described unless one accepted and agreed with their message. As Malina and Rohrbaugh note (Social-Science commentary, 151) this parable draws the classic ancient distinction between "ingroup" and "outgroup". There would be no such thing as a "friendly pagan or atheist" who would have sympathy for the Christian.
In short, it would be illegitimate to take this passage in isolation and suppose that it gives hope for salvation outside of the atoning death of Christ.