This is an interesting question. Actually, I think you're asking two different questions here: (1) Do corporations have a duty to behave in an ethical manner, and (2) Does ethical behavior necessarily involve charity?
The answer to the first question is certainly that corporations do have a duty to behave ethically. They have duties, for instance, not to include false or misleadings statements in their advertisements, not to use harmful chemicals in their products (whether these products are life-saving drugs or sparkly party hats), not to contaminate the water supply, and so forth. The second question is more difficult. After all, ethical theorists disagree about whether and to what extent individuals have a positive duty to give to charity (or, more generally, to be beneficent). And even if you're convinced that individuals do have such a duty, that hardly settles the question of whether corporations have one as well.
I tend to favor utilitarian or consequentialist moral theories. A utilitarian might argue that the best overall consequences would come about if corporations concentrated all of their energy solely on their business and left the charity to the owners or shareholders who receive the profits of this business. This sort of focus on business would insure that the profits available for donations to charity are as large as possible. On the other hand, if the CEO of a corporation has sufficient reason to believe that the shareholders will not donate a significant share of the profits to charity, then perhaps he or she has an obligation to order donations from the corporation itself. But this raises a host of ethical questions concerning the obligations executives have regarding shareholders.