When I was Baptist, I heard many times that Catholics believed they could earn salvation through works, and how wrong this was. When I later started seriously studying Catholicism, I found that this was a huge misunderstanding. In fact, Catholics believe salvation is by grace alone, through faith and works (sorry, no sola fide here). Incidentally, even the sola fide crowd usually agrees that faith cannot be alone, since faith without works is dead (James 2:17).
I see it as part of the commandment to love one another. This isn’t a theoretical love, but a self-giving love, or at least it should be, if we are to imitate Jesus. Take the passage of the sheep and goats (Matthew 25), for example. The works performed were works of love, for both God and neighbour. In fact, the examples given in that parable are known to Catholics as the corporal works of mercy.
Now, does simply doing those things earn you salvation? Of course not! But God gives us the grace to do these works, and we are to serve each other in these ways. Catholics certainly don’t believe that just doing x, y, and z gets you to Heaven. At the same time, doing these selfless works does serve to bring one closer to God, when these things are done sincerely and with no ulterior motives.
Take indulgences, for example. To receive an indulgence, one must go to Confession and receive the Eucharist, in addition to whatever the indulgence is (like public recitation of the Rosary). Is this some magic work or intended to manipulate God? No! But if one is truly praying the Rosary, truly meditating on the mysteries of the life of Jesus, then one is growing closer to God. If one makes a good Confession, truly repenting of all sin, then one is closer to God. If one is receiving the Eucharist worthily, with no mortal sin, and completely focused on receiving the Body and Blood of Jesus, one is close to God. So it is clear that works are necessary, but the works are those of God, of His grace working within us.
As for the misunderstanding, I think that is in part because Catholics and Protestants sometimes seem to speak different languages. Perhaps it would be best if, instead of immediately condemning, we all took time to try to understand what the other side truly meant, by looking at their primary sources. So for Catholics, I recommend looking at the Bible (of course), and the Catechism (which contains all the Scripture references).