Question: Is K meant to be the boy that supposed lived (while the girl survived)? Or did the girl get passed off as a boy? Why does K have her memories? What is the back story to the doctor? Why is she in a containment area?
Question: Why did Niander Wallace kill the female replicant right after creating her? I get that he's crazy, but was there any other reason?
Answer: Think of any manufacturing process. Samples of new products are frequently created and then immediately destroyed. Also, the new replicant would require processing, training, etc. It was simpler for him to just dispose of the test.
Answer: He was being violently petulant at the moment, angry that he couldn't create and control the birth that he just learned occurred with older-model replicants and seeing his new creation as "flawed" by design. Pretty villainous, he cares nothing for the replicants.
Answer: The birth records were purposefully mixed to hide Ana Stelline (Rachael and Deckard's daughter). She was passed off as a boy and raised in the orphanage. K was given her memories because she secretly was giving replicants pleasant memories of her own. She is in a containment area because it is said she has an autoimmune disorder, but this is likely a ploy by the freedom fighters to keep anyone from examining her and discovering that she is at least part replicant.
BaconIsMyBFF