Why would you assume that? Most stock people buy is of American companies.
And hell, even if it was true, what is wrong with investing in foreign companies (of presumably underdeveloped nations)? That money still isn't "doing nothing", but rather giving the funding to companies that need it.
Whats wrong is that this money was generated domestically, and people who generated it are screwed by lack of healthcare, education, housing, infrastructure, transportation, etc.