Is companionship valued in Buddhism?
Yes, but only noble companionship. It's not just half of the holy life, but it is the entire holy life i.e. the journey to enlightenment.
From SN 45.2:
Then the Venerable Ānanda approached the Blessed One. Having
approached, he paid homage to the Blessed One, sat down to one side,
and said to him:
“Venerable sir, this is half of the holy life, that is, good
friendship, good companionship, good comradeship.”
“Not so, Ānanda! Not so, Ānanda! This is the entire holy life, Ānanda,
that is, good friendship, good companionship, good comradeship. When a
bhikkhu has a good friend, a good companion, a good comrade, it is to
be expected that he will develop and cultivate the Noble Eightfold
Path.
“And how, Ānanda, does a bhikkhu who has a good friend, a good
companion, a good comrade, develop and cultivate the Noble Eightfold
Path? Here, Ānanda, a bhikkhu develops right view, which is based upon
seclusion, dispassion, and cessation, maturing in release. He develops
right intention … right speech … right action … right livelihood …
right effort … right mindfulness … right concentration, which is based
upon seclusion, dispassion, and cessation, maturing in release. It is
in this way, Ānanda, that a bhikkhu who has a good friend, a good
companion, a good comrade, develops and cultivates the Noble Eightfold
Path.
Furthermore, you should choose your friends carefully according to AN 7.36:
A friend gives what is hard to give,
and does what’s hard to do.
They put up with your harsh words,
and with things hard to endure.
They tell you their secrets,
and keep your secrets for you.
They don’t abandon you in times of trouble,
or look down on you in times of loss.
The person in whom
these things are found is your friend.
If you want to have a friend,
you should keep company with such a person.”
And AN 7.37:
They’re lovable, respected, and admired,
an admonisher who accepts admonishment,
speaks on deep matters,
and doesn’t urge you to do bad.
The person in whom
these things are found is your friend.
If you want to have a friend,
benevolent and compassionate,
you should keep company with such a person,
even if they send you away.”
On seclusion and pursuing the holy life alone, the famous sutta is the Rhinoceros Sutta (Sutta Nipata 1.3) which I quote below.
All of the following apply only to those who choose the monastic life. It's not necessary for lay Buddhists.
It tells to go forth alone (as a monk) fleeing ignoble companions:
In the midst of companions
— when staying at home,
when going out wandering —
you are prey to requests.
Valuing the freedom
wander alone like a rhinoceros.
There is sporting (flirting) & love
in the midst of companions,
& abundant fondness for offspring.
(While) feeling disgust
at the prospect of parting
from those who'd be dear,
wander alone like a rhinoceros.
People follow & associate for a motive.
Friends without a motive these days are rare.
They're shrewd for their own ends, & impure.
Wander alone like a rhinoceros.
However, it praises the company of noble companions and if there are none, better go alone:
If you gain a mature companion,
a fellow traveler, right-living & wise,
overcoming all dangers
go with him, gratified, mindful.
If you don't gain a mature companion,
a fellow traveler, right-living & wise,
wander alone
like a king renouncing his kingdom,
like the elephant in the Matanga wilds,
his herd.
We praise companionship — yes!
Those on a par, or better,
should be chosen as friends.
If they're not to be found,
living faultlessly,
wander alone like a rhinoceros.
Sometimes the monks wandering alone in the forest become lonely, and they need to be reminded, as we see in SN 9.9 below.
On one occasion a certain monk, a Vajjian princeling, was dwelling
near Vesali in a forest thicket. And on that occasion an all-night
festival was being held in Vesali. The monk — lamenting as he heard
the resounding din of wind music, string music, & gongs coming from
Vesali, on that occasion recited this verse:
I live in the wilderness
all alone
like a log cast away in the forest.
On a night like this,
who could there be
more miserable than me?
Then the devata inhabiting the forest thicket, feeling sympathy for
the monk, desiring his benefit, desiring to bring him to his senses,
approached him and addressed him with this verse:
As you live in the wilderness all alone
like a log cast away in the forest,
many are those who envy you,
as hell-beings do,
those headed for heaven.
The monk, chastened by the devata, came to his senses.