It wasn't legal at the time, that's what's just been established by the verdict.
Apple (uniquely) having a near zero tax rate is considered illegal state aid to a company. Private companies are supposed to operate on the same terms within each European country.