American companies make a lot of money licensing patents in foreign countries.
The US government has worked very hard to make patent protection global. It's not perfect. There are still a lot of costs associated with filing patents in different countries around the world, but it works in general pretty well, which is why Qualcomm is able to not only collect royalties in the US, but also in Europe, China (yes, that China), South Korea, and many other countries, and why drug companies are able to fend off generics for a decade in most locations, except for a couple like India.
All that hard work goes out the window if we start discriminating against foreign owners of patents. And believe me, a lot of countries would love an excuse to not have to pay the US for its inventions.