If you wrote and published a dead tree version of a book where the law changed so the subject of the book was illegal in some way, you would not have the legal right to confiscate and destroy the copies that had already been released.
Um. You would have the responsibility to recall all copies from booksellers, libraries which held copies would be required to remove them from their collections, and used booksellers would also need to remove them from their stock. And individuals who had copies in their possession would now be in violation of the law, and would need to destroy their copies. Providing copies to someone would be a criminal offense, which includes, clearly, private individuals.
In the case of items which are still legal, but the author has chosen to remove them from the standard distribution points, technically making copies of the files to give to someone is violation of copyright. You can give them your copy, but you have to remove it from your storage systems so you no longer have it yourself. When an item goes out of print, but is still in copyright, one can traffic in the existing copies, but making additional copies is a violation of copyright, unless you have made arrangements with the copyright holder.
There's the concept of "fair use", but that only covers making copies of small portions of published works, such that no substantive harm is done to the copyright holder's revenue stream. "Fair use" limits the number of copies that can be made, and the percentage of the item that can be copied, without needing to work on copyright clearance.