The issue is Apple didn't pay the normal (and already very low) standard Irish corporate tax. It made a deal to pay even less (something Luxembourg did too when its leader was Juncker...).
Now, if some specific company gets a better treatment than others, it can be ruled a "state aid" - the government "pays" the company renouncing to taxes - which is forbidden by EU rules. More even so when you're a country that gets more EU funds than what it pays. Yes, you can try to retain business, but you still need to play by the rules you agreed to - including advantages (funds) and disadvantages (no state aids).
Anyway the very fact that some companies can discuss with governments about how much taxes they would like to pay looks to me something that shakes democracy from the foundations - it undermines equality before the law - if you let someone obtain its own law.