Listen to the picture that Jesus paints of the Final Judgment in today's reading from Matt. 25-26 (ESV)
So let's see if I'm understanding what Jesus is teaching here...
The "sheep" always did good and always showed compassion to those who were in need, so they went to heaven, but the "goats" never did anything good and never showed compassion to anybody who was in need, so they went to hell... right?
Wrong! Even just by living in this world, we can see that's not the case! Many times we Christians have our particularly "off days" where we could've and should've shown love and compassion to somebody, but we didn't. And many of the non-Christians around us put us to shame on a regular basis through the ways that they dedicate themselves to helping the needy, serving various charities, etc., etc.
So the answer to what Jesus is really teaching here can be found in the question, "Why do we or why don't we show compassion and love to others?" For example, many people call themselves Christians, but don't see the point in doing good works because they figure that they'll be forgiven anyhow. Likewise, many people who don't consider themselves Christians constantly try to do all kinds of good works, but they're trying to do them to earn forgiveness and acceptance from their "god" or "gods".
The point is this. It's not our acts of love or compassion that save us. Paul makes that especially clear in Ephesians 2:8-9. Otherwise non-Christians would be saved right alongside Christians on the Last Day. Our acts of love and compassion are only judged as "good" in God's eyes when we do them because we're forgiven rather than to earn forgiveness and acceptance before Him! Notice that in the story the sheep weren't even aware that they'd been "helping Jesus" in most of the cases where they did! That's because they weren't going around trying to "rack-up points" to get themselves into heaven! The acts of love that they did for their fellow man stemmed-from their love for Jesus, and their desire to live lives that were obedient to Him because of all that He had done for them!
So what's your motivation? Don't show love and compassion to others to "earn God's favor"... Jesus already did that for you on the cross! Instead, show love and compassion to others because Jesus already did that for you on the cross.