Capitalism as in the private accumulation of large sums of capital.
if you give away your large sums of capital, then it isn't the accumulation of large sums of capital anymore, and therefore isn't capitalism.
Charity is very much a part of capitalism, if you want it to be. That's sort of the point. The choice of being able to keep your money or donate v. the requirement to give away most/all of what you earn to the state.
Charity is neither unique to capitalism nor a testament to it working. It's rather a monkey-patch fix to make it look more viable than it is - people think everything's fine as long as a few "heroes" donate.