 The word rendered charity in the King James Version is agape love. The motivation that is behind one's actions is indeed important. Paul even said that if one went as far as to give their own body a sacrifice and it was not out of love, it would be of no benefit.