In this case it's quite easy: Luxembourg does not discriminate between the companies that want to use their country for tax breaks, they will all be treated/taxed the same. Ireland did not apply the same tax rate on every companies, which distort competition and is anti-market behavior, and the ECJ just validated that.
It is interesting how places like Luxembourg get away with similar antics.