The essential difference is that when you buy a used book (or a used CD, for that matter) or check one out from the library, you are not creating a new instance of that book. When you rip the CD, you are creating a new instance, which is what you are not allowed to do (outside of certain exceptions) according to copyright law, just as if you photocopied the book.
As far as downloading single songs, you can do that inexpensively from several sites, and occasionally from a performer's website (which is sometimes the best option, if you are attempting to get the most money to the performer).
One can make various moral and ethical arguments about what one thinks is appropriate, but in legal terms, when you create the new instance you're violating copyright law, unless the use happens to fall into one of the very few (and much narrower than many think) exceptions.
Best wishes, Ericka