The majority of veterinarians recommend that female dogs be spayed before their first heat. If spayed (also known as ovariohysterectomy; i.e., removal of ovaries and uterus) before their first heat, the incidence of malignant mammary carcinomas (i.e. breast cancer) is only .05%, but if done after the first heat, that incidence jumps to 8% and, by the second heat, the incidence has increased to 26%. For this reason alone, it is not wise to wait for your dog to have a heat before spaying.
However, this is not the only reason. There is also the chance (however remote) that your dog will accidentally mate with a male dog while in heat and this could result in an unwanted litter of puppies. Ovariohysterectomy prevents unwanted heats, which in turn keeps your dog from escaping from the home and roaming around in search of a male and attracting males to your house.