Sanhedrin 54: Punishment and Warning

Why does the Torah say both?