For the Captain, killing is a hard, dirty job. He often spends days at a time hunting down the rebels--sometimes killing them and sometimes capturing them to later torture and execute. He may well be the most hated man in the village though, in his mind, he is only doing the job which he has been assigned. For the barber, killing the Captain is also not an easy choice. He is not a trained soldier, and spilling blood does not come easily for him. The barber also worries about how people will think of his method--slitting the Captain's throat while he is in the barber's chair; spilling blood also goes against the barber's most important code. But perhaps the barber's biggest worry is what his life will be like if he kills the Captain. Where will he go? Will he ever be safe? In the end, the barber's cowardice wins out, as the Captain had suspected all along.
I do not agree with Bullgatortail with his last answer. It is not the barber's cowardice that wins out. The barber came to an epiphany that revenge only begets more revenge because "First ones kill the second ones and they the next ones and it goes on like this until everything is a sea of blood." In the end, the barber dies an "honorable" death because he is able to end the chain of violence. He realizes that if he gains what he desires while losing his soul in the process "What do you gain by it? Nothing." "No one deserves to have someone else make the sacrifice of becoming a murderer."
As for the captain, he knew that the barber is a revolutionary who hated him. Therefore the reason he came to the barber is because he wanted to die. He antagonized the barber with the hope of being killed. Torres wanted to "go straight to sleep" "without any effort."