The man charged with murdering a Spencer, Iowa, resident has been sentenced to spend the rest of his life in prison.