Dogs have wet noses to improve their sense of smell and help regulate their body temperature. The wetness is a combination of mucous and saliva from the dog licking its nose.
The wetness of the nose helps absorb the chemicals that cause scent, letting the dog detect even very faint odors. Dogs have additional olfactory glands on the roof of their mouths, and when they lick their noses, they help transfer scent to those glands. They also lick their noses simply to keep them clean. Since dogs have very few sweat glands, they sweat through their noses. The evaporation of the sweat and mucous helps keep them cool during hot weather.
Although many people believe that a dry nose is a sign of illness, that is not always true. Some dogs have less mucous or do not lick their noses as often, resulting in a dry nose. A warm, dry nose is especially common after a dog has been sleeping. However, unusual dryness can be a sign of illness. Thick or colored mucous or a runny nose are also signs a dog may be ill.
Folklore also offers explanations for why dogs have wet noses. A popular Christian legend is that one of the dogs on Noah's Ark found a small leak and used its nose to plug the hole.