They're not really getting a reward, because this makes them much less attractive for investment. Meaning less tax revenue in the wider and longer perspective.
I guess, but given this precedent, I doubt anywhere else in the EU is going to give a better deal, so all the companies where Ireland gave them illegal deals probably won't have any reason to move to Germany or Spain or Belgium. Ireland probably gets to keep their business and tax revenue going forward, as well as getting back taxes.
They're not really getting a reward, because this makes them much less attractive for investment. Meaning less tax revenue in the wider and longer perspective.