When Sora stops to think, he realizes that loving is just a part of his nature. He loves all his friends, and makes friends with nearly everyone he meets. He cares about each of them and honestly wants them all to be as safe and happy as can be. Perhaps this was why it took him so long to realize just how much Riku and Kairi meant to him.
By nature, Sora isn't the sort of person who puts one person above another. Riku became his best friend, the person he spent the most time with, the person he told all his secrets. But it just sort became that way before he knew it. Riku chose him as his best friend and would hang around him even when he spent time with other friends. Sora wasn't one to hold secrets in the first place, and it just happened that Sora found it easier to talk to Riku than others.
Actually, Sora was a little relieved when Kairi washed up on shore and turned their duo into a trio. Giving so much attention to Riku and getting so much in return made him feel a bit guilty, and having Kairi join in spread that attention out. If circumstance gave him favorites, at least two spread that favoritism out. And Sora tried his best to treat them as equals, if not the same (because he wasn't about to go around punching Kairi when her back was turned like Riku liked to do to him).
Before that night when darkness swallowed them, he had not wanted their relationship to change. He liked the way they balanced out. If one of them was busy, the other two could hang out together. If he wanted to fight he had Riku. If he wanted to build sandcastles he had Kairi. Riku always made them stop to contemplate big questions like whether or not all the worlds were connected by a single ocean, a single sky. Kairi was always there to make sure they stayed safe. No more jumping off the tallest tree, no more breath-holding contests to the point where their faces would begin to turn blue, no more dares to see which of them would eat the random blob they found on the ground.
Once the world was devoured and he was spit back out, alone, without friends for the first time in his life, the two of them were the only ones he could think of. This sole focus was what made him realize how much he missed them. How much he wanted to see them again. But he still wasn't one to play favorites, so Donald and Goofy soon filled the hole in his heart—except they didn't, not really. Instead they filled a new space they had carved for themselves alone, leaving Kairi and Riku's spot hollow.
Meeting them again was a mess of emotions. Relief that they were safe. Disappointment in Riku's disregard for anyone other than Kairi. Sorrow at Kairi's broken state. Betrayal. Peace. Desperation. He fought so hard to get through all those challenges only to be separated from them both again. And in those parting moments, he realized their feelings for him, the love and trust in their eyes.
It grew like an obsession inside him; he needed to see them again. He needed to be with them again. But Riku was lost, then hiding, and by the time he found him again it was by Kairi's side. They were all different by this point, but Riku more so. His face was a distorted image, but his heart was there, calling to Sora even if his legs were still trying to run. Standing there with their hands touching, their hearts finally joined once again, was when he realized that somehow, from the deepest depths of his heart, he had come to love them more than anyone else.
Even now he loves unconditionally, freely and nondiscriminatory, but he has mastered the art of extending that much more toward them alone, and in different ways. In ways he never thought he would but finds himself enjoying. Kissing along skin, hugging and cuddling, keeping secrets, hopes, and wishes between just the three of them. He finds that he enjoys this change, enjoys having favorites, having two that he can call his.
His relationship with them may still not be exactly the same. He and Riku connect in a way he can't with Kairi—who has never faced a legion of darkness and lived to have nightmares about it, who has never fought him as a mortal enemy—and he and Kairi connect in a way he can't with Riku either—who has never had a nobody, who never forgot Sora existed. He always tried to love equally, but now he is beginning to realize that is both impossible and unnecessary. Each person is unique, and to love them any other way than their own unique way is to demean that. He can love Riku for his perseverance and intensity while loving Kairi for her empathy and understanding. That isn't wrong, it is as it should be. As long as he loves them both with all his heart, in all ways possible, uniquely and unconditionally, he knows that is all they will ever ask of him.