There are two main ways in which espionage attacks from foreign countries (I assume that we are talking about attacks on American firms, as opposed to attacks on governmental institutions) can hurt the American economy.
First, the American economy can be hurt by the loss of secrets that are taken in the attacks. Let us say that an American company has come up with a new and innovative way to make a certain product. It should reap the economic benefits of that innovation. Consider, then, what happens if that secret is stolen. In that case, foreign firms will be able to use the innovation to compete with the American firm. This will reduce the American firm’s profits.
Second, the American economy can be shaken by a loss of confidence in corporate security. If large American banks are hit by cyberespionage attacks, people will have less faith in those banks. If firms lose their corporate secrets to such attacks, they will be reluctant to spend as much money on research and development. This sort of loss of confidence affects the entire American economy, not just the firms that have actually been hit.
Thus, corporate espionage from abroad can do real damage to the US economy.