It has long been believed that humans evolved smooth penises as a result of adopting a more monogamous reproductive strategy than their early human ancestors. Those ancestors may have used penile spines to remove the sperm of competitors when they mated with females.
Researchers, while studying another topic, stumbled upon one explanation by comparing the human and chimpanzee genomes:
They first systematically identified 510 DNA sequences missing in humans and present in chimps, finding that those sequences were almost exclusively from the non-coding regions of the genome, between genes. They then homed in on two sequences whose absence in humans they thought might be interesting -- one from near the androgen receptor (AR) gene and one from near a gene involved in tumour suppression (GADD45G).
Inserting the chimpanzee sequences into mouse embryos revealed that the former sequence produced both the hard penile spines and sensory whiskers present in some animals. The latter sequence acted as a kind of brake on the growth of specific brain regions -- with the removal of its function appearing to have paved the way for the evolution of the larger human brain.
Link | Photo by Flickr user lightmatter used under Creative Commons license