It would be difficult to enforce because almost all of the communication for offshore contracting is done via the Internet which essentially ignores borders. To enforce such a law would require a government audit or a great change in the way the Internet operates. It might be possible to control it by tracking payments to known offshore contractors.
The U.S. is commited to free trade. Like so many other business transactions, the Congress looked at the issue from the perspective of what we would get without considering what it would cost the country. It only takes a few people to design and develop products. The jobs are in the production. When you consider TV, Computers, Cell phones, Internet, GPS and on an on, offshoring knowledge based jobs are a tiny slice of the big pie.