eBooks may well have a place in your book collection, but it might be a mistake to think of them in the same terms as hardcopy books. Most ebooks are encrypted and this copy protection (digital rights management) means you can expect to lose them at some point.
The key question is whether the ebook you buy is encrypted (encoded) or not.
It's relatively easy to tell. You have to look at the small print from the publisher. If they tell you your ebook can only be read on a limited number of computers (usually between one and seven), then it's encrypted. That's how the publisher keeps control over copying.
The ebook you download can't be read without an electronic key to unlock it. You're loaned the key, but not exactly given it. This is all sorted out behind the scenes and is invisible, so unless you read the small print you don't know it's happening.
You may be allowed to print the book, or transfer it to a limited number of handheld devices, but ultimately your decryption key is still on loan and it could be lost.
If, for example, you change your computer a few times, you may finish up exceeding the number of keys you're allowed to keep. ePublishers differ in their limitations, and many allow you to transfer reading rights from one computer to another, but that's only useful if you know about it and if you don't lose a computer to hardware failure or a virus.
Also if the epublisher who sold you your book, or the software company that supplied their encryption system, goes out of business, you've probably lost your purchase.
Broadly, the key system means your ebook is on loan. It could be a long-term loan, but you never really own it. Often this is acceptable, for example if you're studying and need a text book for a few years, or if you want to read a popular novel that you don't expect to read again. But it's no great way to build up a long term digital library.
Encryption is similar for ebooks and music files. See How Apple Fairplay Works.
If it really is unencrypted, you should be able to read your ebook indefinitely – or at least until its electronic format falls out of favour.
Overall, encrypted ebooks are on loan. Non-encrypted ebooks will survive as long as their electronic format survives. It's quite different to buying a paper book.