Not salvation by works
I understand his passage the same way I understand James 2:14-18. Jesus is not saying that we are saved by our works, but that our works are evidence of our salvation. As Christians, we have a kingdom obligation to care for the poor and needy. Not caring is not an option. Jesus says that whatever we don't do for "the least or these," we also didn't do for Him. Therefore, to neglect the poor and needy is to neglect Christ Himself.
Another interesting thing in this passage is Matthew's use of "adelphon," or brother (vv 40 and 45). Every other time Matthew uses this word, it is not in referring to all humanity, but to an actual biological brother, or to a spiritual brother, i.e. a Jew referring to another Jew. Therefore, it's likely that when Jesus says "the least of these brothers of mine," He is referring to believers, Christians. If that's the case, we are going to be judged based on our response to our fellow believers who are in need.* James 2:1-7 speaks to this also.
*(for more on Matthew's use of brother, read "Preaching the Parables" by Craig L. Blomberg)
Another interesting thing in this passage is Matthew's use of "adelphon," or brother (vv 40 and 45). Every other time Matthew uses this word, it is not in referring to all humanity, but to an actual biological brother, or to a spiritual brother, i.e. a Jew referring to another Jew. Therefore, it's likely that when Jesus says "the least of these brothers of mine," He is referring to believers, Christians. If that's the case, we are going to be judged based on our response to our fellow believers who are in need.* James 2:1-7 speaks to this also.
*(for more on Matthew's use of brother, read "Preaching the Parables" by Craig L. Blomberg)