All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His Slave and Messenger.
In principle, it is not permissible to plant trees in the graveyard and they should not be left in it according to the preponderant opinion of the scholars. Shaykh Muhammad ibn Ibraaheem Aal Ash-Shaykh said in his Fataawa: "It is not permissible to plant trees in the graveyard. It is an imitation of Christians who make their graves like gardens; therefore they have to be removed."
Since those trees were cut off and sold, there is nothing wrong with benefiting from their price and spending it in the interests of the graveyard according to the preponderant opinion of the scholars. Al-Fataawa Al-Fiqhiyyah Al-Kubra by Ibn Hajar (Al-Haytami) reads: "The judge has the right to sell its (the graveyard's) trees and spend their price in its interests... Its interests are many according to the determination of a just and trustworthy judge. If it has no interests, he should keep the price until it has interests in the future and it should not be spent on anything else, like when there is money due for the Masjid on the someone who occupied a place of it, then it should be spent in the interests of the mosque not the interests of Muslims, as stated by An-Nawawi and Al-Ghazaali unlike Ibn Razeen."
Allaah Knows best.