We can't run a society based on companies being moral. We need laws regulating it and in this case, it seems like the EU is actually enforcing them.
I.E. apple's "but this guy down at the pub told us it was legal"* defence fails the bonus pater standard as apple highly paid legal council should have known better then accept it as a indication of actual law.
*In reality there was a unpublished letter from some politician, who did not actually have the authority to speak on irish tax law, to apple stating that Irish revenue would not challenge apple's claims about not owing Irish taxes on money in transit. though all evidence point to apple knowing full well that was not an indication that their tax sceme was legal.