Life is difficult for everyone. We all have stress and we all need someone in our lives that we can lean on. Never think that you cannot talk to someone because they have problems too or that your friend or loved one would be better off without you or your problems. You'll soon find out that they need you just as much as you need them. — Joshua Hartzell
The consensus is that the cast members who wound up in the sideways church at the End needed each other in order to get into the after life.
That may be true, but were they really friends?
Friendship is the emotional bond and personal conduct of individuals towards others in their group; a state of mutual trust and support.
It is fairly clear that most of the main cast had no true friends prior to landing on the island. We never saw them hanging out shooting the breeze with a friend or close colleague. Jack, Kate, Sawyer, Sayid, Locke, Desmond - - - they really were loners. Hurley and Charlie used to have best friends, but events changed and broke those relationships. Even Ben had one childhood friend, but we don't know what ever happened to her. Due to Ben's power lust, he had no adult friends but followers.
But even throughout the island events, the main characters really did not form strong bonds or undivided loyalty or trust amongst each other.
Jack never trusted Locke. Locke never trusted Jack.
Kate was flippant on whom she aligned herself with, either Sawyer or Jack.
Hurley was friendly to everyone on the island, but he was probably closest to Charlie until Charlie decided to make his move with Claire.
Sawyer only trusted Sawyer.
Ben sought the trust of the candidates, but it was all a manipulation.
How Ben became Hurley's island buddy post-Jack guardianship is one of those mysteries that we will never know. Congenial colleagues, maybe.
So in the church, we have a mixture of people who really did not get along with each other. Rose and Bernard left the group over the group's petty bickering and insane confrontations with danger. Desmond was always the lone outsider in the group after the Hatch imploded. Penny was never part of the island circle. And Jack and Kate's relationship was one of love-hate; why they sat together was that was the best leftover among the group. Even Locke had no friend sitting next to him in the church finale. In the sideways world, he had a perfect life with Helen. But she was not with him. How sad was that?
I think friendship is a major theme in the series. But even throughout the dangers of the island, the bonds of friendship between the major characters was weak. Many veterans come back from the battlefield stating that the men in the foxholes became their best friends. It was the situation and need to survive that brought units of individuals together as a single mind. But once they return home, and disperse across the country, it is rare that those veterans keep in contact. They move forward in their lives.
The concept of moving forward is another theme in the series. But even as the island events ended, it seems the LOST souls never truly wanted to move on. That is evidenced by the fact that they wound up together in the church, not knowing what would come next.