What people fail to realize is that ebooks sometimes cost libraries more money than physical books. The libraries buy them with cost of degradation in mind, so after x number of lends, they have to repurchase the book in order to keep making it available to their patrons. This is how they're able to make an agreement with the publisher in order to legally provide you with a digital lending library.
Careful there, you might burst the libertarian-leaning conceit behind the "difference" between libraries & unregulated e-books: if libraries didn't already exist today with centuries of tradition in their foundations, the very suggestion of an institution like them would be met with howls of the inevitable destruction of the written word and bankrupting of our already starved wordsmiths.
I'm pretty sure that the law does not permit you to re-sell digital copies. As when you purchase a digital book (DRM or not), you don't own the digital copy - you're only granted a license to use it for your own use. This license does not extend to reselling it (what your suggestion would be doing).