Maybe it depends on the children, I know of many lovely children who became prefects and head boy/girl. In schools i've been in it is based on interviews, they get the role if they seem the most competent and appropriate for it.
Also people change and grow up, 11/12 year olds who displayed bad behaviour in the past, maybe because of immaturity or negative personal circumstances, might then mature into sensible and kind 16 year olds. And it would be unfair to judge someone forever for behaviour from when they were a child.
Maybe the "lovely" children who were never mean, have no leadership skills or confidence for public speaking. Maybe despite being lovely, they are stuggling academically and therefore shouldn't be given extra responsibilities that take away from their learning time. Maybe they are uncharasmatic in interviews and were too quiet to make any impression of being capable to lead and represent the school.
Maybe the children who were unpleasant in the past and who have matured are naturally good leaders who perform well when given responsibility.
At our school, prefects run study groups for younger children who are stuggling or need help with homework and some help in a 'peer of confidence' role where they talk to students who are behaving badly and who dont interact with staff.
maybe the lovely children are the kind who have never overcome struggling in classes or behaving badly. As a result of their natural ability maybe they dont have the skills to pass on, about how to learn when you find learning difficult.
Sometimes it just isn't the right role for them, and its not about over rewarding bad behaviour, to the detriment of the 'lovely' kids.