I'm aware of two major interpretations of Mulholland Drive. The first: that the purpose of Diane's dream is that she wanted to be Camilla and also wanted to own Camilla — for Camilla to be dependent on her — in essence to switch roles. In this formulation, Rita is a reinterpretation of Camilla primarily in body but more like Diane in soul. The second: that the purpose of Diane's dream is her wish to split off her dark, evil side (in the person of Rita) from her light, good side (Betty). So Betty plus Rita equals Diane. But in Diane's dream fantasy, Diane becomes Betty — assuming she can cast off Rita and keep them "divorced," although this eventually fails.
The second theory is by far the most important and points to the central purpose. The first becomes a part of the second by simply being absorbed by it. And note: even the second theory isn't the overriding purpose — but it puts us on the way to it.
Diane does not expect to be rid of her dark half. So she wants to reconcile with it — come to terms with it — accept it fully as a real part of her — in other words, to live with it to the fullest extent possible. Because it's really herself. But there's more. Diane believes that the only way to fully accomplish this is to fall in love with her dark half — really herself — the rest of herself. She needs it to love her back. When you think about it, this is all natural enough. Diane simply wants to love herself (Betty plus Rita). This is something that as human beings we all want — in fact need — to do.
Now, Diane is Betty in the dream, as she views her good side as dominant — though it's "latent" in real life. She does not know until the end of the dream that Rita — her dark side — is the true dominant side. Why does Rita look like Camilla? To make Diane's dark side as attractive as possible, making her easier to fall in love with. I believe Rita is the bum, just all dressed up and made lovable. It was no random choice for Lynch to have cast a female in the bum's role. Note that, other than Diane, only two individuals ever handle the blue box: Rita and the bum.
Dan (the dark-haired guy at Winkie's) is the only witness to Diane's evil act. Diane can't repress her act, nor her dark side, even in the dream. But if she can kill Dan off, she can at least get through her dream easier, pretending that her dark side isn't that bad. Thus, she kills off the only witness, then proceeds to gradually "cosy up" to her dressed-up dark side (Rita) with the hopes of a reconciliation — an acceptance. The result is that Diane will love herself.
Diane/Betty needs Rita's expressions of love for her in order to become really whole again. She believes she has to fall in love with her dark side — really herself. But she needs more: she needs it to love her back. When you think about it, this needs the "dark" to still "exist," but no longer as a separate entity — it would be absorbed by the dominant Diane-as-Betty. As a whole being, finally in love with herself, Diane believes that not only would her suicidal depression naturally abate, but her latent powers — talent, self-confidence, attractiveness — will naturally emerge and shine.
Later on, in a scene from the reality part of the film, Camilla calls but Diane doesn't pick it up right away. The answering machine repeats "Hello, it's me. Leave a message." This shows that in the dream, Betty is actually calling "herself" — Diane — while trying to discover Rita's identity. It really seems as if Diane's dream presents two aspects of herself, Betty and Rita, calling Diane in what looks like an attempt at self-identification.
So the key scene in the dream is in bed, where Rita does not return Betty's expressions of love for her. This is precisely where the dream starts to go out of control and come apart. After they make love, we see their faces merge. It becomes clear that what's happening is that Betty is being absorbed by Rita. Right after this, Betty starts to lose control and becomes dominated by Rita, as Rita practically drags Betty off to Silencio. Betty's facial expressions on the journey to Silencio — for the first time she's lost, frightened, out of control. More like Diane. Finally, back in the room after the discovery of the blue box, Betty is the first to disappear, as she becomes completely absorbed by Rita.