This sounds like the main problem here, to me:
EU law makes it easy for a company to do business anywhere in EU and only pay taxes in its headquarters, on the assumption that it doesn't matter a lot where the company pays its taxes as long as it's inside the EU. But at the same time, EU law doesn't regulate corporate tax, so some countries can easily take advantage of that by lowering them (or completely removing them) so companies will be attracted there.
They are basically living as parasites to the other countries, and the only solution to that seems to be harmonizing taxes accross the EU.
Edit: could you explain the downvote a bit? I'm curious to hear what you don't like in what I said.