Too many foreign investments in a country can be bad for national security. The citizens of a nation should be able to enjoy its natural resources. There are many examples of countries with large oil resources where foreign companies come in, expoit the land, take the resources, and leave nothing for the native people.
Foreign investment in the American economy is just as beneficial to the economy as domestic investment. For example, a foreign firm building a factory and employing hundreds of American workers provides just as much a boost to the American economy as an American firm doing the same. And Americans are just as able as foreigners to own stock in those foreign corporations, so the profits can be realized by Americans as well.