Apple broke the law. Ireland provided Apple with false assurances that they were tax compliant, but there was nothing stopping Apple being fully aware of applicable EU tax laws.
Perhaps Ireland should be punished (though the government is already arguing there is reputational damage), but you really cannot reasonable argue that Apple is not culpable.