Sex offenders must have chance to change, says Supreme Court