It is not permissible to sell or buy a waqf
Question

Two men turned most of their property into a waqf (endowment) for the sake of Allah, may He be glorified and exalted, but after they suffered financial hardship, they sold part of this waqf, and after they died, their heirs sold another part of it. My father bought some of these properties from another man, who had bought them from one of the sons of the two men. What is the shar‘i ruling, and will my father be sinning if he sells these properties or uses them after buying them?
Praise be to Allah.Firstly:
Al-Bukhaari (2764) and Muslim (1632) narrated that ‘Umar ibn al-Khattaab (may Allah be pleased with him) wanted to give some palm trees of his in charity, so he consulted the Prophet (blessings and peace of Allah be upon him). He instructed him to turn it into a waqf (endowment) and said: “Give it in charity as a waqf that is not to be sold, given as a gift or inherited, but its yield may be spent (on charitable causes).”
The version narrated by Muslim says: “it is not to be sold or bought.”
Al-Haafiz Ibn Hajar (may Allah have mercy on him) said:
Ad-Daaraqutni added, via ‘Ubaidullah ibn ‘Umar, from Naafi‘: “A waqf that will remain as long as the heavens and the earth remain.”
End quote from Fath al-Baari (5/401).
Shaykh ‘Abdullah al-Bassaam (may Allah have mercy on him) said:
From the words “that is not to be sold, given as a gift or inherited” is taken the ruling on how a waqf is to be dealt with. It is not permissible to transfer ownership of it, or to dispose of it in a way that will lead to transfer of ownership. Rather it is to remain as it is, and is to be managed in accordance with what was stipulated by the one who set up the waqf, provided that there is no injustice or unfairness involved.
End quote from Tayseer al-‘Allaam (p. 535).
The words of the Prophet (blessings and peace of Allah be upon him), “it is not to be sold or bought” indicate that it is not valid to sell or buy a waqf.
Abu’l-Hasan al-Maawardi (may Allah have mercy on him) said:
Purchase of a waqf is invalid, according to scholarly consensus.
End quote from al-Haawi (3/332).
Secondly:
If someone designates something as a waqf, that is binding, and the one who designated it no longer has any right to dispose of the property that was designated as a waqf, so it cannot be sold, given as a gift or inherited.
The one who establishes a waqf has no right to take back that property, even if he needs it.
The scholars of the Permanent Committee for Iftaa’ were asked about a man who gave some land as a waqf to be used as a graveyard, and for several years nobody was buried in it, then he reached the age of retirement and wanted to take it back, or part of it, because he needed it. Is that permissible?
They replied:
It is not permissible to take back the land that you designated as a waqf, or to take back part of it, because it passed out of your ownership when the waqf was established, and it is only to be used for the purpose that you stipulated. If it is needed in that district for the purpose of burial, all well and good, otherwise it may be sold and the price used to buy land for a graveyard elsewhere, and that transaction is to be done with the knowledge of the qaadi (judge) in the area where the land that was given as a waqf is.  
The fact that your financial situation got worse after retirement does not justify your taking back your waqf. Put your hope in Allah that He will reward you and compensate you with something better than what you gave.
End quote from Fataawa al-Lajnah ad-Daa’imah (16/96).
Thirdly:
The one who takes control of a waqf and sells it has wrongfully seized this waqf, even if he was the original owner before it became a waqf. What he must do is return it, or give something else instead if it is not possible to return the original. This ruling applies to everyone who acquires a waqf through purchase, rental, as a gift or as an inheritance, and so on.
In the answer to question no. 10323, we explained that those to whom seized property passes via the one who seized it wrongfully are all liable for the seized property if it is destroyed, such as the one who bought it or the one who rented it.
In all cases, if the second person was aware of the facts of the matter, and that the one who gave it to him was the one who had seized it wrongfully, then he is ultimately liable, because he deliberately transgressed against the property of someone else. If he was not aware of the facts of the matter, then liability is borne by the one who first seized it wrongfully.
It says in al-Fataawa al-Kubra by Ibn Taymiyah (5/418):
It says in al-Muharrar: Whoever takes possession of wrongfully seized property from the one who seized it wrongfully without knowing, then he is as responsible as the one who originally seized it with regard to making him liable for the property or the benefit thereof. But liability may settle with the one who originally seized it, when the one who acquired it from him is not obliged to bear liability. End quote.
Ibn Rajab (may Allah have mercy on him) said in al-Qawaa‘id (p. 210):
Whoever takes possession of wrongfully seized property from the one who seized it wrongfully, and was not aware that it was wrongfully seized, then according to the well-known view among our companions, he is as responsible as the one who seized it wrongfully with regard to bearing liability for that for which the one who seized it unlawfully in the first place is liable, in terms of property or the benefit thereof. End quote.
Conclusion:
Your father’s purchase of that waqf is invalid, and it is not permissible for him to take possession of it and make use of it. Your father should return it to the one who sold it to him, and take the price back from him, and the waqf should go back to being a waqf as it was before.
This is what is required according to sharee‘ah.
And Allah knows best.