But if it has files that are not yet deleted, why do you want to steal someone's wallet.
This is the tech board, not moral board. Who the legal owner is may depend on local laws. If you buy a hard drive, one could argue the data on it is your too. If someone is dumb enough to sell a disk with their private keys, they can assume someone is going to take it.
Now that I think about it: if I sell a hard drive, I'll leave some random data looking like private keys on there

Most places have interesting laws about that. But for the most part, yes if you buy something with data on (drive) or in it (say a file cabinet) then that data and any value from it is yours. Barring copyright and stuff like that.
Kind of like if you buy a safe at a garage sale and it's filled with cash, that cash is yours. But, obviously things like that will vary based on local laws.
Back to this, as I said without more info it's going to be tough to figure out what can be done.
But thinking about what LoyceV just said I think if I ever retire and decide to get rid of all the old drives I have after I do a secure wipe & erase. I will then put on an old OS and some random data and see what happens.
Old people have to have fun too

-Dave