On one occasion the Blessed One was living in Savatthi in Jeta's Grove, Anathapindika's Park. There he addressed the monks thus: "Bhikkhus, be my heirs in Dhamma, not my heirs in material things (material wealth). Out of compassion for you I have thought: 'How shall my disciples be my heirs in Dhamma, not my heirs in material things?' If you are my heirs in material things, not my heirs in Dhamma, you will be reproached thus: 'The Teacher's disciples live as his heirs in material things, not as heirs in Dhamma'; and I will be reproached thus: 'The Teacher's disciples live as his heirs in material things, not as his heirs in Dhamma.' But "If you are my heirs in Dhamma, not my heirs in material things, you will not be reproached and I will not be reproached."
Out of compassion for you I have thought: 'How shall my disciples be my heirs in Dhamma, not my heirs in material things?' Now, bhikkhus, suppose that I had eaten, satiated not desiring any more and some alms-food was left over to be thrown away. Then two bhikkhus arrived hungry and weak and I told them: 'Bhikkhus, I have alms-food of mine left over to be thrown away. Eat if you like; if you do not eat then I shall throw it away where there is no greenery or drop it into water where there is no life.' Then one bhikkhu thought: 'The Blessed One has eaten enough but there is this alms-food of the Blessed One left over to be thrown away; if we do not eat it the Blessed One will throw it away. The Blessed One mentioned to be heirs in Dhamma, not heirs in material things." Now this alms-food is one of the material things. Instead of eating this food, I shall pass the night and day hungry and weak. Then the second bhikkhu thought: "The Blessed One has eaten but there is this alms-food of the Blessed One left over to be thrown away. Suppose that I eat this food i will pass the night and day neither hungry nor weak. In this simile of the two monks, the first bhikkhu is more to be respected and commended. Why is that? Because that will for long conduce to his fewness of wishes (less desires), contentment, effacement, easy support, and arousal of energy. Therefore, bhikkhus, be my heirs in Dhamma, not my heirs in material things. That is what the Blessed One said. Having said this, the Sublime One rose from his seat and went into his dwelling.
Soon after he had left, the venerable Sariputta addressed the bhikkhus thus: "Friends, in what way do disciples of the Teacher who lives secluded not train in seclusion? And in what way do disciples of the Teacher who lives secluded train in seclusion?" (Question: how far the disciples of the Buddha practiced or failed to practice detachment that forms the chief characteristic of the Buddhist way of life?) Bhikkhus: "Indeed, friend, we would come from far away to learn from the venerable Sariputta the meaning of this statement. It would be good if the venerable Sariputta would explain the meaning of this statement. Having heard it from him the bhikkhus will remember it." Venerable Sariputta: "Then, friends, listen and attend closely to what I shall say. In what way do disciples of the Teacher who lives secluded not train in seclusion? They do not abandon what the Teacher tells them to abandon; they live a luxurious life and careless, leaders in backsliding, neglectful of seclusion. In this case, the elder bhikkhus are to be blamed for three reasons: 1. As disciples of the Teacher who lives secluded they do not train in seclusion 2. They do not abandon what the Teacher tells them to abandon 3. They are luxurious and careless, leaders in backsliding, neglectful of seclusion
In this case, the middle bhikkhus are to be blamed for three reasons: 1. As disciples of the Teacher who lives secluded they do not train in seclusion 2. They do not abandon what the Teacher tells them to abandon 3. They are luxurious and careless, leaders in backsliding, neglectful of seclusion
In this case, the new bhikkhus are to be blamed for three reasons. 1. As disciples of the Teacher who lives secluded they do not train in seclusion 2. They do not abandon what the Teacher tells them to abandon 3. They are luxurious and careless, leaders in backsliding, neglectful of seclusion It is in this way that disciples of the Teacher who lives secluded do not train in seclusion.
Venerable Sariputta: "In what way, friends, do disciples of the Teacher who lives secluded and train in seclusion? The disciples abandon what the Teacher tells them to abandon; they are not luxurious and careless, they are keen to avoid backsliding, and are leaders in seclusion. "In this case, the elder bhikkhus are to be commended for three reasons: 1. As disciples of the Teacher who lives secluded they train in seclusion 2. They abandon what the Teacher tells them to abandon 3. They are not luxurious and careless; they are keen to avoid backsliding and are leaders in seclusion.
In this the middle bhikkhus are to be commended for three reasons: 1. As disciples of the Teacher who lives secluded they train in seclusion 2. They abandon what the Teacher tells them to abandon 3. They are not luxurious and careless; they are keen to avoid backsliding and are leaders in seclusion
In this the new bhikkhus are to be commended for three reasons: 1. As disciples of the Teacher who lives secluded they train in seclusion 2. They abandon what the Teacher tells them to abandon 3. They are not luxurious and careless; they are keen to avoid backsliding and are leaders in seclusion It is in this way that disciples of the Teacher who lives secluded train in seclusion.
Venerable Sariputta: "There friends, greed is an evil, anger is an evil. To dispel greed and anger, there is the middle path which conduces to wisdom, giving vision, knowledge enlightenment, leads to peace and to Nibbana. What is that Middle Way? It is just this Noble Eightfold Path: right view, right intention, right speech, right action, right livelihood, right effort, right mindfulness, and right concentration. There friends, anger is an evil, ill will is an evil, hypocrisy is an evil, mercilessness is an evil, envy is an evil, selfishness is an evil, deceit is an evil, craftiness is an evil, obstinacy is an evil, haughty talk is an evil, measuring is an evil, conceit is an evil, intoxication is an evil, negligence is an evil, To dispel intoxication and negligence, there is the middle path for the abandoning of vanity and negligence, which conduces to wisdom, giving vision, giving knowledge, enlightenment and to Nibbana.
That is what the venerable Sariputta said. The bhikkhus were satisfied and delighted in the venerable Sariputta's words.
In summary, the Buddha explained to the monks what is the difference between the inheritance of the Dhamma and getting the worldly benefits from the Dhamma, to his disciples. He then guided them on how to obtain the true inheritance of the Dhamma and avoid material gains. From the Buddhist point of view, the root-cause of suffering is desire and so it is necessary for us to overcome desire if we want to achieve liberation. Venerable Sariputta also told the monks the benefits of the noble eightfold path (The Middle Way) which will lead to wisdom and enlightenment as this path will help us eliminate unwholesome defilements.
References: 1. www.accesstoinsight.org 2. https://suttacentral.net/ 3. The middle length discourses of the Buddha (Bhikkhu Bodhi)