> The difference is that Google isn't pirating the book. It is being hosted on Google Docs. This is no different than if someone put the PDF on Dropbox and made it public. It isn't Google's pirate link.
Google has just exploited a loophole in the law that allows them to provide all the technical expertise and infrastructure to profit from piracy, while remaining legally non-liable.
It's not a "loophole", which implies an unitended gap in the law; the entire intent of the DMCA safe harbor, which was a centerpiece of a debate about the law itself, is to protect online content hosts from liability for copyright violations resulting from digital distribution of user-submitted content in cases like this, so long as they abide by a specified takedown process.
How is Google profiting from this piracy? There are no ads on the search results page. Considering that one can purchase Python for Kids on the Google Play Store (at least in the US), Google is actually losing money by allowing this.