The first and most obvious function is protection. In an uncircumcised male the glans (head) of the penis is highly sensitive and vulnerable to abrasion and frostbite. This is probably less important now that we have pants, but there are still situations where a bit of foreskin can come in handy. On one of his polar treks, the uncircumcised Sir Ranulph Fiennes had a better time of it than his circumcised comrades who were subject to blistering and frostbite in an area you really don't want to get frostbite. Now given that most men are unlikely to engage in polar expeditions or off-trail nude hiking, the protective function is probably not a make or break issue. But that doesn't mean we should be hacking off foreskins just for the hell of it.
The second major function is sensation and it is this function that paradoxically provided the original rationale for excision. Foreskins feel good. How good I'll never know, because mine was ripped off long before I had a chance to compare. But a friend who became circumcised as an adult described the difference in pleasurable sensation as akin to the difference between black-and-white and color. The reasons for this are twofold. First, when the foreskin is removed, the normally moist surface of the glans becomes keratinized, a process where the epithelial cells become dry and harden. Nerve endings ultimately die off and sensation is lost.
Secondly, the foreskin is dense with nerve endings, particularly in the ridged band at the base of the foreskin and the frenulum along the underside of the penis just below the glans. Both these structures contain Meissner's corpuscles which are fine touch receptors (also found on the tips of fingers, the lips and nipples). Meissner's corpuscles do not detect pain but are exquisitely attuned to light touch. It's been observed that men who have been circumcised are far less interested in foreplay than uncircumcised men. They also whack off less, which depending on your point of view can be good or bad. Certainly in the 19th century, when masturbation was seen as the root of all disease, this observation was behind much of the propagation of circumcision.
I thought an argument could be made that if circumcision desensitizes the penis it may help prevent premature ejaculation. Sadly though, this doesn't appear to be the case. It certainly wasn't with me. If the race to orgasm was an Olympic event I'd have won the gold hands down. If anything, the increased sensation of the foreskin allows for greater control. It's been described as the difference between having an accelerator and a simple on-off switch.
The foreskin also provides protection in the early years against infection. The mucosa layer on the underside of the foreskin contains enzymes called lysomes that attack the cell walls of bacteria. It's believed that the reason the foreskin does not generally retract in infancy is to allow these antibacterial properties to act as a bulwark against the bacteria present in the child's own feces. All in all, not bad for a little piece of vestigial skin.