Codpieces weren't worn for 'medical' purposes as scholarly historians would have you believe. While the issue of objectifying women is generally frowned upon by society - more so at the turn of the century - men have been actively seeking this sort of objectification from way back when, around the 16th century when codpieces were a thing. It's the guy equivalent of pairing a pushup bra with a low cut top. Guys walking around in skinny jeans that show off their lumpy man bits know exactly what they're doing.