Do works matter? Well, yes and no. In the matter of salvation, no they don't - seems like we all know that. Do they matter to God?
Are not some "works" the fruit? Are we not instructed to look after the "widows and children"? (And you are correct, there are lots of verses that could be quoted regarding works)
I don't mean works in exchange for anything, of course. But works of the heart are freely given, just as Christ freely gave to us.
The passages in Matthew 25 remind me that when I give freely to others (whether it be in the material, the spiritual or just of my time); when I am giving in love, expecting nothing in return, I am giving back to Jesus. No, no matter what we ever do, we cannot "payback" what Christ has done for us. We can never "outgive" God. But in loving Him, I do "works" for the sake of loving Him.
Gracey

(not to be confused with grace)
Mat 25:35 For I was an hungred, and ye gave me meat: I was thirsty, and ye gave me drink: I was a stranger, and ye took me in:
Mat 25:36 Naked, and ye clothed me: I was sick, and ye visited me: I was in prison, and ye came unto me.
Mat 25:37 Then shall the righteous answer him, saying, Lord, when saw we thee an hungred, and fed thee? or thirsty, and gave thee drink?
Mat 25:38 When saw we thee a stranger, and took thee in? or naked, and clothed thee?
Mat 25:39 Or when saw we thee sick, or in prison, and came unto thee?
Mat 25:40 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.
Mat 25:41 Then shall he say also unto them on the left hand, Depart from me, ye cursed, into everlasting fire, prepared for the devil and his angels:
Mat 25:42 For I was an hungred, and ye gave me no meat: I was thirsty, and ye gave me no drink:
Mat 25:43 I was a stranger, and ye took me not in: naked, and ye clothed me not: sick, and in prison, and ye visited me not.
Mat 25:44 Then shall they also answer him, saying, Lord, when saw we thee an hungred, or athirst, or a stranger, or naked, or sick, or in prison, and did not minister unto thee?
Mat 25:45 Then shall he answer them, saying, Verily I say unto you, Inasmuch as ye did it not to one of the least of these, ye did it not to me.
Mat 25:46 And these shall go away into everlasting punishment: but the righteous into life eternal.