Damaging Tree
The Rishonim are undecided regarding a tree that causes damage. The dispute is based on the following story mentioned in the Gemara (Bava Basra 26):
“Rava bar Rav Chanan had palm trees that stood adjacent to the boundary of Rav Yosef’s vineyard. Birds would come and roost on the palm trees and subsequently descend to the vineyard and damage it. Rav Yosef said to Rava bar Rav Chanan: Go and cut down your palm trees. Rava bar Rav Chanan said to him: But I distanced them the required amount. Rav Yosef said to him: This matter, i.e., this specific distance, applies only to trees, but a greater distance is required for vines.”
The Rishonim are in dispute as to what was exactly the content of the argument between them. Most (Ramban, Rabbeinu Yonah, Rashba, Ritva) agree that Rava bar Rav Chanan believed he did not have to cut down the palm because of Hilchos Nezikin. Therefore, he told Rav Yosef – although I would like to behave in a righteous manner and not cause you any damage, since according to my opinion I am not obligated to cut down the palm, if in your opinion it causes damage and permissible to be cut, you may cut it yourself.
Tosfos, however, disagrees and explains that although Rava bar Rav Chanan agreed that he was obligated to cut down the palm because of the damage it caused, he refrained from doing so because of the danger involved.
Rav Elchonon Wasserman hy"d (Kovetz Shiurim, Bava Basra 94) explains that most of the Rishonim see the issur in damaging another as a result of the issur of gezel, therefore, one must cut down a damaging tree so as not to steal. However, Tosfos is of the opinion that the issur to cause damage does not constitute gezel and is just a violation of the prohibition to damage others. Therefore, Rava bar Rav Chanan had to choose which issur to violate: 1) ba’al tashchis - not to ruin something useful, or 2) the issur to damage others. In any case the owner of the tree will be sinning. Therefore, it is better to sit back and do nothing than to actively perform an aveira.
Damaging Kevarim [Graves]
Sometimes, there is a fruit tree near a kever and its roots are entering the kever, causing damage to the gravestone and the actual kever. The poskim offer some reasons to allow cutting away the roots or the tree to save the kever: it is a mitzvah purpose; it might be forbidden to benefit from the fruits since they grew by a kever (Rema, Yoreh Deah 368:1), in which case there is no issur to destroy them (Da’as Moshe, siman 37); and other reasons (see Shu”t Shevet HaLevi 2:207)