If you are an artist reading this I am sure you have been asked to donate a piece of work to a charitable cause. I often wonder how many electricians, plumbers, carpenters and other tradespeople are asked to donate their work to charity. It probably happens but maybe not as often as artists are asked to donate. I think this is partly because art is eye-catching and will bring people in to the charitable event but I also do think there is an element of 'the artist is doing this because they love doing it and it's not really work anyway so lets ask for a piece for free'.
However as artists we can turn this around to our advantage and feel virtuous about supporting a cause. Often it is a sign that people really like your work if they ask for your work specifically, so if it is a big event with many people attending your work will get good exposure - think of it as promotion. I think the key is to know what kind of people will be attending the event and of course for you as the artist to know who your customers are - when the two coincide then there is a perfect opportunity to donate a piece of work. The charity will gain a donation and you will hopefully attract new customers. If the charity in question is not one who's goals you agree with or the audience will not be your market I would feel absolutely no guilt in turning them down.