From Wikipedia
Rome was essentially a landowning military aristocracy. From the early days of the Republic, ten years of military service were a citizen's duty and a prerequisite for election to public office. Devotio (willingness to sacrifice one’s life to the greater good) was central to the Roman military ideal, and was the core of the Roman military oath. As a soldier swore to give his life (voluntarily, at least in theory) for Rome's victory, he was not expected to survive defeat.
The Punic wars of the late 3rd century BCE – in particular the near-catastrophic defeat of Roman arms at Cannae – had long lasting effects on the Republic, its citizen armies, and the development of the gladiatorial munera. In the aftermath of Cannae, Scipio Africanus crucified Roman deserters and had non-Roman deserters thrown to the beasts. The Senate refused to ransom Hannibal's Roman captives: instead, they made drastic preparations: