Lain eventually realised that she had to become God, and in order to do that she had to erase the memories of all of the people she had affected. In order for her to become truly omnipotent, she had to exist outside of the physical world. The ending was NOT, in any way a "Reset button" ending, as you seem to be implying. The Other Lain even OFFERS Lain the chance to reset everything, but she declines to do so. The ending was simply intended to show Lain finally discovering her own identity and elevating herself to Godhood. She could hardly become a God if people in the "real" world knew of her existence, and even had MET her at some point. Alice was her catalyst. After Masami Eiri had attempted to manifest with terrifying results, Alice had become catatonic. Lain loved her more than anything else, possibly in a platonic way, possibly in a sexual way. In order for Alice to ever be happy again, Lain would have to delete her self from everyone's memories, and in turn existence. As she herself observed, she messed up everything she tried to do for Alice. And after all, perhaps Masami Eiri survived the assault by the technology of Lain's room. In order for her to truly defeat him, she would have to delete herself from existence, because it was the fragments of her personality that had caused him to try to transfer his consciousness to the Wired and elevate HIMSELF to Godhood. As he did this because of her, she would need to remove herself from existence in order to wipe every trace of him from the wired and force him to become just a regular worker at Tachibana labs, without a thought of Godhood ever crossing his mind. And let's not forget the Knights. Perhaps they engineered all of this. After all, they had the last laugh. In the altered world that Lain created, all of the Knights were presumably alive, albeit with no knowlege of the god they once worshipped. And the Men in Black, along with their client who turned against them, would continue to be a threat to Lain, the people she cared about and all of reality as long as Lain existed. There were various reasons for her to do what she did, depending on how one interprets the ending. And Lain met Alice again, even though she didn't know who Lain was. But she did seem familiar. Lain herself says: "You're right. We can see each other again anytime.", hinting that perhaps Lain was always in control, and not everything needed to be sacrificed when she recreated reality.