Training a generative model on a book is the mechanical equivalent of having a human read the book and learn from it. Is it stealing if a person reads the book and learns from it?
Downloading the book without paying for it, which is more or less what the judge said.
Photocopying books in their entirety for commercial use is absolutely illegal.