Well, the uncomfortable truth is that our copyright regime doesn't really make sense. An AI is sort of the equivalent of a junior coder or an art student - it can look at existing work and mash it up and produce something in the same style that's novel (inspired by a prompt - which is like your teacher giving you an assignment). That's copyrightable when it's a human being doing it, and there is no inherent protection for art
style, I can make all the Picasso-style artwork I want even if I'm blatantly ripping off his style, and I would own the copyright on the resulting works. Like, if I do a painting in the style of Picasso, should Picasso get the resulting copyright? Why?
And programmers are not without sin either - how many people here run to stackoverflow and copy some answer, or mash it up and produce something similar-but-cleaned-up? That's going to get a lot more powerful in not too many years too... and the thing is, is your little DTO file with blocks of fields and setters and getters really novel and worthy of a government license to cultural exclusivity, or is it a relatively obvious implementation of an API? Which (per Oracle v. Google) are also not really copyrightable...
Humanity hasn't squared the reality of most content being low-value generative trash already (despite being human-generated!) with the reality of a system that automatically awards up to ~150 years of exclusivity (lifetime of the author +75 years). Like, that's the long and short of it. A lot of what we do as humans is just building up a squishy water-filled neural net ("how to make a painting in the style of Picasso") and running random prompts and goal-seeking through it and cleaning up the generative output. Now AIs have gotten to the level of "average college student" and it turns out that's not actually all that difficult or interesting anymore, but we're still working in this model where that's supposed to be worth ~150 years of cultural exclusivity and protection automatically.
If you only get copyright on the things that are truly novel and have no previous creative basis or cultural/stylistic heritage... that's a pretty big change to the copyright system for humans too! Especially in light of the fact that there's only a few ways to implement most configurations/functions... does Spring own all the copyright to your config classes because they're basically doing the same thing as the spring demo projects? hard to see much novelty in that sort of thing pretty much ever, so those probably should not be copyrightable at all under a "totally novel" requirement, but if they do surely Spring owns the copyright.
As mentioned in a sibling comment, the "at scale" bit is surely relevant in a practical sense, but, it doesn't change the underlying-principles basis. This is a situation where "at scale" has just thrown the underlying problem into stark relief. A 2-lifetime (life of author +75 years) governmental grant of cultural exclusivity doesn't really make sense in a world where humans are constantly and trivially mashing up each others' ideas even within a single lifetime, it just doesn't fit the way we exchange ideas in general. And now you have the college-student-bot that can generate a million shitty DTO classes or artworks-in-the-style per day that makes that plain. But ultimately it's just doing the same thing as an art student but faster... if you put an art student in a Mechanical Turk box and made them draw whatever you demanded, would they not own the copyright? And would it be a problem if India had an art school that set up an "industrial art" process and employed a million students in boxes drawing whatever you said to draw? It would probably be problematic for DeviantArt commissioners, but would it violate the principle of copyright?
We just haven't managed to square that reality where most human works are fairly trivial derivatives of other works (your deviantart commissions really don't mash up any similar works or styles that came before? really?) and yet worthy of 150 years of license to cultural exclusivity. And the college-student-bot is blowing that model up. People still need to eat, of course, but that's an orthogonal problem to the societal framework we've set up not really making sense. We can solve the copyright problem and not the eating problem (as we have many times before - buggy whip manufacturers adapted too), or we can solve the eating problem and not the copyright problem, or solve both or neither. People not being able to eat and shelter themselves is a capitalism problem, not a GPT problem, and we will probably have to address the idea that everybody needs to work to survive as machines continue to displace the last strongholds of human labor (as I'd argue creative work has become). We should not be restricting our ideas on collaboration and cultural generation just because it produces inconvenient outcomes for the current copyright regime and capitalistic model, the model needs to bend to fit humans and not the other way around.
This isn't the only place the inherent contradictions and problems of copyright come up either. The idea that a nighttime photograph of the Paris skyline could be copyrighted by someone else other than the photographer who created it is pretty janky too. Is a photographer not adding significant creative value with composition/etc? Literally just having that one element makes my photo derivative? Maybe that's the analogy to GPT/stable-diffusion I guess - but the thing is, it still works the same with a human as with a robot, an AI-generated Paris skyline still would be copyrighted by the architect too. And if the argument is that the code owner or original artist owns the style, then, Pablo Picasso owns the copyright to all my paintings too, just like the architect of the Eiffel Tower owns the copyright to my photographs of the Paris nighttime skyline. And Spring (or Oracle!) owns the copyright to a great deal of your Java code. So that probably is not going to work out great for you either.