You can sell a library just as well as any other piece of software I think.
Services, in this article, doesn't refer to things that can only be built as services (e.g. because it queries a proprietary dataset) but those that might optionally be built as services (e.g. fetching and processing otherwise accessible data) and could, as easily, be built as a library.
Basically where most devs selling commercial software live on.
Copyright infringement is very rarely a crime.