When you do this kind of stuff, you make American companies less competitive as a whole. If GM can get as good software for cheaper by outsourcing (granted, they almost certain cannot), then they should do it because that might help save tens of thousands of other jobs within the company and broader economy. The government should not generally be in the business of telling companies how to build software.
I don't agree with this. The US government needs to encourage an economic structure that is best for US citizens. The company is not looking to save other jobs, but rather to increase their profits for stakeholders. Other industries are highly regulated, such as Medicine, Law, or otherwise have tariffs that combat against this. This is also a slap in the face to the US citizens that bailed out the company previously.
Literally everything that does not require a US stamp or certification is being outsourced. Mechanical Engineering, Civil Engineering, non-software architecture, customer support, project management, and even accounting. This is not good for the US as a country. American workers are not competitive right now, unfortunately, considering the high cost of living and strength of the dollar. Also, American workers will find it hard to get a work visa in a very low cost of living country if they do wish to pursue a career where their field has been outsourced.