The outrage against Luxemburg for their tax antics leaves out one important factor: the degree to which anything done in Luxemburg affects tax collections in Spain is purely determined by Spain’s willingness to recognize them.
A simplified explanation of how this works:
Company imports widget into Spain and sell it 100 euros. Actual cost to produce/sell/market/transport said widget is 50 euros. If the company were completely honest, it would have to pay taxes on the profit of 50 euros in Spain.
Why Luxemburg is useful here is basically to inflate the cost of the product, by paying essentially fictitious interest, royalties etc to a Luxemburg company and then deducting these costs from profits in Spain.
This only works because Spain and Luxemburg have a tax treaty that recognizes costs and taxes paid in one country against the taxes to pay in another. It does require a certain level of honesty from the partner country.
The key piece that is missing to make this work is exchange of information. If Spain does not know the overall picture of all the subsidiaries in all countries, then it is impossible to know if a company is complying with even existing tax rules. This is why the fact that these tax deals in Luxemburg were secret is such a big deal.
One alternative would be to say: “Fine, you can only get relief from double taxation if you provide a complete picture of your corporate matrix”.
Of course, this only works if a large enough set of countries all agree, which Luxemburg, Holland and Ireland have been sabotaging at every opportunity.