When Ānanda says that good friendship is half of the spiritual life, the Buddha corrects him, saying that it is the whole of the spiritual life. The Buddha explains that good friendship is the basis for the development of the Noble Eightfold Path.

Upaḍḍha sutta - Half The Spiritual Life

Thus have I heard - At one time, the Blessed One was dwelling among the Sakyans, in a town named Nagaraka, a market town of the Sakyans. Then Venerable Ānanda approached the Blessed One, paid homage to him, and sat down to one side. Seated to one side, Venerable Ānanda said to the Blessed One:

"Venerable sir, this is half of the spiritual life, that is, good friendship, good companionship, good association."

"Do not say that, Ānanda, do not say that. The whole of the spiritual life is this good friendship, good companionship, good association. It can be expected, Ānanda, that a bhikkhu with good friends, companions, and associates will develop and extensively cultivate the Noble Eightfold Path.

And how, Ānanda, does a bhikkhu with good friends, companions, and associates develop and extensively cultivate the Noble Eightfold Path? Here, Ānanda, a bhikkhu develops right view dependent on seclusion, supported by dispassion, based on ending, culminating in complete relinquishment; similarly he develops right intention, right speech, right action, right livelihood, right effort, right mindfulness, and right collectedness, dependent on seclusion, supported by dispassion, based on ending, culminating in complete relinquishment. It is in this way, Ānanda, that a bhikkhu with good friends, companions, and associates develops and extensively cultivates the Noble Eightfold Path.

By the following method too, Ānanda, it may be understood how the entire spiritual life is good friendship, good companionship, good association: by relying on me as a good friend, Ānanda, beings subject to birth are freed from birth; beings subject to aging are freed from aging; beings subject to death are freed from death; beings subject to sorrow, lamentation, pain, displeasure, and despair are freed from sorrow, lamentation, pain, displeasure, and despair. By this method, Ānanda, it may be understood how the entire spiritual life is good friendship, good companionship, good association."