The idea that Keyblades reject those who chose darkness is a misconception. The Keyblade doesn't really care what a person aligns themselves with, but it's primary concern is strength of heart. Darkness, while not evil in itself, is a naturally corrosive substance. Inproper use of the darkness weakens the heart which is why KK eventually rejected him. Not only had Riku's heart become weaker because he recklessly dove nto darkness, but because he denounced the heart all together as an innately "weak thing".
Terra, while he also didn't know how to handle the darkness, also spent years strengthening his heart, so by the time he started being enveloped by the darkness, his heart was probably stronger than Riku's at the time it started happening to him.
Also, there was the unique case of the KK having a choice between two people. Granted, a Keyblade doesn't have to go to another person to reject its weilder as it's implied in 3D that Xehanort's Keyblade ditched him for a while, but a lot has to happen before that happens.