Females - spaying will stop the bleeding that occurs with every heat cycle and prevent any changes in behaviour associated with heat cycle. Females that are not spayed, but who do not have puppies, may develop false pregnancy or infection in the womb. Early spaying of females reduces the risk of them developing mammarycancer (breast cancer) later in life.
Males - some male dogs develop antisocial behaviour when they reach maturity. This may be in the form of aggressive or sexual behaviour - mounting other dogs or people!! Uncastrated dogs, if left to their own devices, may patrol a wide area in search of a mate and can detect a female in season a long way away. A dog who wanders is far more likely to be involved in a car accident. Castrating male dogs also reduces the risk of them developing diseases of the prostate in later life.