A lot of people who afford to give whatever they can give to charity just want to help someone else - plain and simple. It's true that some people donate because of tax deductions (and they figure, "better a charity than the government" or whatever else is involved in their donating). It's true that some people give to charity because they think they'll "look good" in the eyes of God, or that it will help get them into "Heaven".
Some people feel a social responsibility to "give back" if they are fortunate enough to be able to give to charity. Some have had some disease or other thing in their life (like a parent with a heart attack or a premature baby), and they'll believe a charity for that cause is an important one to donate to. Some people donate in the memory of a loved one.
Having said all that, there are lots and lots of people who just see suffering, want to try to do whatever they can, and find that donating is one of the more effective ways to try to help. Many people give without hoping to get anything back (not even anything in terms of emotional reward). There's nothing "dirty" about hard-earned money, so I don't think a lot of people are looking to "purify" it.