At first, the codpiece was entirely
a practical matter of modesty. Men's
hose were typically very
snug on the legs and open at the crotch, with the genitalia
simply hanging loose under the
doublet. A shortening of
the doublet resulted in often-exposed genitalia, so the
codpiece came into being (there are other versions of the
origin of the codpiece).
As time passed, codpieces were shaped
to emphasize the male genitalia and eventually often became
padded and bizarrely shaped. They also often doubled as
pockets, handy carrying
places for a variety of items.
Armour of the 16th c. followed
civilian fashion, and for a time armoured codpieces were
a prominent addition to the really best full harnesses.
Few of these are in evidence today, though the Metropolitan
Museum of Art in New York City does have one on display.
[Source - this paragraph:
Arms and Armor of Medieval Knights:
An Illustrated History of Weaponry in the Middle Ages
- David Edge]