The Keyblade chooses a person with a strong heart not pure light. Master Xehanort and Terra used the darkness, why didn't they lose theirs? Sora received his because he needed to protect his friends on the island, Riku got his at the time because he was trying to protect Kairi. Sora was connected to Ventus too who was asking Sora to be his friend and he wanted to help him as well. Besides, Lea receives a Keyblade too. He had a strong enough heart to retain his form when he became a Heartless and Nobody, which is how he got his when he came back.