Although they were fine with nudity in certain situations, such as during athletic competitions and on stage, ancient Romans thought it was rude and shameful to expose the head of the penis in public. To get around this, they would tie the foreskin shut around the tip of the penis, and attach a string to the waist to keep the head hidden from view.
Some went further, though, and used fibulas, ancient safety-pin-like brooches, and rings which pierced the foreskin and kept it shut. These rings and fibulas were more permanent than string, and were meant to prevent masturbation and sex, because, as historian Kate Lister said in "Sex: A Bonkers History," it was believed that gladiators would be stronger if they "kept it all in" and didn't ejaculate.