On a website I visit from time to time, someone asked the perennial question about Matthew 25:31-46 and what it means about salvation. Here's my answer...
Things to note in the passage:
1) Matthew often has very strong and stark divisions of humanity into two groups.
2) This is judgement on the basis of how people treat the disciples, which has consistently been linked in Matthew to how people treat Jesus (e.g. 10:40). "These brothers of mine" is a clear reference back to 12:50, where it is "whoever does the will of God".
3) This is judgement of who is in which category, not how people get into each category - they're already sheep and goats here, the question is how the judge tells which is which. Getting to be a sheep is by grace, through faith. Staying a sheep is by grace, through faith. Distinguishing between sheep and goats is here done by their attitude to other sheep.