I would imagine that it is the intention of the fellow with the gun to shoot whoever had been having carnal knowledge of his wife.
The implication is that so many of the clients of the bar had had their way with her, that the supply of bullets available would be insufficient to shoot each one of them.
In short, his wife is a serial adulteress.
Jokes are never as funny when you have to explain them!