Competing for foreign investment is not stealing. What you're implying is that small countries should know their place, not rock the boat too much and above all else, never dare compete with bigger countries...or else. Needless to say, such a stance is antithetical to the very foundations of the European Union. The free movement of capital, labor and goods & services is a whole package - you cannot pick the parts you like and disregard the parts you don't because they're not to your advantage.
That’s a misrepresentation of the situation. Developing EU countries are not currently and can’t compete for foreign investments with the block heavy weights. They have neither the infrastructure nor the human capital to do that. The bigger European countries are the one heavily investing in the developing countries for manufacturing.
Also obviously the EU can put in place any kind of controls it deems necessary on the common market. It’s sovereign in this matter after all and tax dumping is mostly helping foreign-based multinational corporations.