Maybe Ven was turning into an unbirth or something.. or maybe he was falling more and more under MX's control, so he asked Aqua to erase him, so that he wouldn't become a threat to her and maybe Terra. By "erase," it was to eliminate him, but Aqua couldn't totally go through with it, so she ended up somehow isolating a fragment of his being, then placed it in Sora for an unknonw reason. Seriously though, Aqua's fairly skilled at magic. Maybe, she knew how to isolate a part of someone's being and placing it in others or maybe she was just learning how to erase, but screwed up and part of Ven ended up reappearing in Sora.