A 23-year-old man has been sentenced to 25 years to life in prison for killing a former schoolmate whose body was found in a creek bed outside Binghamton.