I think Riku came to treat Maleficent not like a friend exactly, but like a colleague, a working relationship they could both benefit from. Part of it was that he was isolated from Sora, so there wasn't exactly anyone or anywhere else to go to. And here was someone willing to give him more and more power that he could show off to Sora, so why not stick around with her? I think the only thing Riku actually did for Maleficent in the end was kidnap Jasmine and fight Beast.
As a side note, I think the moment Riku opens his heart to Ansem, he was no longer in control at all. All of the disdain from Riku / Ansem was entirely Ansem, imo, much the same way Xehanort completely takes over Terranort and left Terra no control whatsoever. So I don't think that was a reflection of Riku's feelings towards Maleficent exactly, merely those of Ansem SOD. I'm really not sure how Riku would interact with Maleficent now. I think he would be uncomfortable around her simply because she would remind him of what he's ashamed of or he would simply be dismissive of her.
Kidnapping Jasmine was a pretty big deal though. I mean, she was/is a princess of heart and Maleficent needed her to carry out her plans. Also, he did fight Sora a few times in Monstro and Neverland. Was that for Maleficent, or for himself? An argument could be made either way.
Good points re: Ansem being the one in control showing disdain to Maleficent. Interesting that Ansem would view Maleficent so negatively, but Xehanort would see her as a valuable pawn in his grand plan. I'm rather surprised Maleficent went against Xemnas in KH2 but wasn't seen actively working against Xehanort in KH3. While I prefer the version of Maleficent we got, I do think it was rather inconsistent with the character they had set up in KH2.
Replaying KH1 I took note of how often Maleficent was warning her co-conspirators not to let the darkness overtake them. Even back then, she cared a little, in her own way. She doesn't delight in everyone's misfortune anyway. Her heroic deeds in KH2 were a huge progression for her, so it's too bad Sora seemed to have completely forgotten about them by KH3, because maybe he could have been the bridge to reconciliation between Maleficent and Riku. I'm sure there's more she could teach him about dark magic, and even if she was still in villain mode, it would be cool to have some interactions with a wicked character that isn't them just threatening you or saying ominous things.
Since I'm sure both characters will continue to play their own part in the story, I hope their paths cross again, and hopefully more than just once.
Jafar, Hades, Ursula, Oogie and Hook were a means to an end for Maleficent. I don't think she truly cared about them, she just wanted to make sure her plans came to fruition. This is rather inconsistent; Hook questions Riku on what Maleficent's planning and Riku claims he doesn't know, but earlier in the game, she's seen conversing/plotting with Jafar pretty heavily. But I don't think she really cared about any of her allies, nor do I think she really cared about Riku. I'm more interested in how Riku feels about Maleficent.
I don't see Maleficent ever reconciling with Sora. Sora ruined her plan in KH1--easily her plan thus far that had the most potential for success. Her search for the BoP doesn't seem to be going well, and I'm doubtful she'll be able to take on the foretellers group that was shown having the black box at the end of KH3. Likely, she'll be relegated to side villain status once again moving forward.
Perhaps she could try to get her group together again or persuade Riku to join her, but I don't see either of those things happening. Hades was very dismissive of her and Pete in KH3. And I don't see Yen Sid or Mickey letting Riku join Maleficent. If she tried to "speak to the darkness sleeping in his heart" like she did Terra, I definitely don't think it would be as successful for her. Perhaps she could get Terra to join her though? But I'm doubtful they'll go down that road with him again. Aqua? I mean, she was in the realm of darkness for so long that maybe her heart is full of darkness?
It's going to be interesting to see what happens with Maleficent going forward either way. I do hope we get some discussion on the Riku x Maleficent dynamic. Like I said, I'm much more interested in how the real Riku would interact with the real Maleficent now than the other way around, or how they'd interact with data versions of each other.