Also it's not only the work of "the model" it's the work of human beings the model is trained on, often illegally.
This seems like intentionally conflating them to imply that appropriating code for model training is a criminal offense, when, even in the most anti-AI, pro-IP view, it is plainly not.
This is false, at least in general usage. It is very common to hear about civil offenses being referred to as illegal behavior.
I think it’s very much an open debate if training a model on publicly available data counts as infringement or not.