Earlier quoted context omitted.
I'm not sure what society you are referring to but contracts have to adhere to laws in the EU. This is also about software that is being updated. So the transaction is not completed yet. Apple could probably go the route of not providing the update to phones that were sold before the law was voted on/in place. I would guess that would lead to other legal battles.
And is it reasonable that the laws are created after the contract was already agreed to and still apply to it? At least here in the United States, laws are not allowed to make things illegal that happened before the laws were written.
Also the DMA didn't fall from the sky one day and enforced the next. Every business impacted had years to do something about it, and they preferred to play chicken race instead.