Because the models are not creating a 1:1 replacement of the original work.
As mentioned before "style" is not something subject to copyright and the model creates a model of that style. The process of finetuning a model generally means that one would not want to recreate the original images as that would overfit it and render it, essentially useless.
When it comes to code, there is a higher chance of getting a one-to-one clone of the input as the options used in creating an algorithm, or even a simple function are dramatically reduced imo.