Economics is not a morality play, and from a global perspective, net exports (that is, exporting more than you import) are not a virtue.
Where there is a country that exports more than it imports, there must necessarily be a country that imports more than it exports. That's just simple math.
This trade automatically is reflected in a flow of monetary assets from the importer to the exporter; in this case, a (partially indirect) flow of monetary assets from Spain to e.g. Germany. That's also just simple math.
Speaking as a German, it is incredibly frustrating that this simple insight is almost never acknowledged in public discussion here. There is simply no way the Euro can survive while Germany insists on being a net exporter forever.
What is even more frustrating is that the German elite successfully plays a divide-and-conquer strategy. Most people perceive the Euro crisis as "Germans against the South", whereas in reality, it is the German elite against the German and the Southern people, considering that the German net export "success" has largely been managed by keeping German wages low (when measured against the appropriate benchmark, i.e. productivity).