Socially responsible investing (e.g., divesting from certain companies for the purpose of social impact) is somewhat better than regular investing, but not by much: see Founders Pledge’s “Impact investing is only a good idea in specific circumstances”. So I wouldn’t worry about doing regular investing instead of socially responsible investing, if you plan on donating your earnings.
Socially responsible investing (e.g., divesting from certain companies for the purpose of social impact) is somewhat better than regular investing, but not by much: see Founders Pledge’s “Impact investing is only a good idea in specific circumstances”. So I wouldn’t worry about doing regular investing instead of socially responsible investing, if you plan on donating your earnings.