A lot of wiretaps are technically illegal--not sanctioned by a court order. Law enforcement use them to gather investigative information. The FBI was notorious for using nonsanctioned wiretaps to intimidate witnesses and defendants.
Some of Castellano's wiretapped conversations were cited in "Boss of Bosses," but Castellano was long dead by the time the book was published. Some of Gotti's wiretapped conversations were made public because they were played at his last trial, and were part of the record.