The US Constitution delegated certain powers to the states, and one of those powers is the ability to enact their own criminal code. We have 50 different states with 50 different criminal codes, like 50 mini-laboratories conducting research on the criminal justice systems. States are allowed--while being sure to remain within US Constitutional bounds--to prioritize OR de-prioritize certain criminal acts and assign a punishment the state legislature deems fit. So some states have life in prison without the possibility of parole as their ultimate sanction, while others have the death penalty as theirs.
The federal government itself has the death penalty as a sanction, but many states have chosen not to utilize it due to the cost and lengthy appeals process that sometimes sees an individual waiting 20 years to be executed due to him/her exhausting all their appeals.