Legally too - once you sell the CDs, the license to that music goes with the CDs to the new owner. You never really own the music, just a license to listen to it at your convenience, and the license stays with the disc. That's why, if you run over your discs with a steamroller, you have to buy new CDs instead of getting free replacements - you don't own the music, just a piece of plastic and a license to listen. Sell them, and the buyer now has a license to listen to the music, and you don't any more.
That's where an interesting question pops in. If you bought a license to the music, then the medium is irrelevant -- you bought a license and can listen to it. So you still have that right if the medium is destroyed. But they don't want you replacing music where the medium was destroyed without buying another license. The copyright cartel likes to have it both ways as far as restrictions on the consumer are concerned: you only bought a license, and you only bought the medium.