Source: Economist
Trade deficits, or more concretely current account deficits, have to be financed by net capital inflows, and it is really the cause of the deficit and the nature of the financing that determines whether or not persistent trade deficits are harmful. If a country is running a trade deficit mainly because domestic investment levels are very high, the high investment levels should generate enough growth in the economy that the costs of servicing the foreign capital inflow can easily be covered. In that case many years of trade deficits are unlikely to be a problem.
If a country is running large and persistent trade deficits, however, because a surge in domestic credit has boosted consumption levels excessively and so reduced savings levels, then the resulting increase in debt is clearly unsustainable and will have eventually to be resolved by a reversal in the trade deficit. This is the problem countries like Spain are facing. What is often not recognised is that the credit-fueled consumer boom in Spain was actually caused as much by consumption-repressing policies in Germany as by domestic distortions, and so without a reversal in German polices (and surplus countries historically never accept their responsibility for having created trade distortions), the only way Spain can resolve the persistent trade deficits is via default, devaluation, or very high levels of unemployment for many years. This is a classic kind of "bad" persistent trade deficit.