A dog should be what the breed standard describes. And that is structure, over all look, and very much so, temperament. A dog should be a minimum of 2 years old and any genetic health testing that can be done, should be done. The pedigree should be examined to see what ancestors of the breeding dogs died from and how long was their life. If there are health issues that can not be tested for, due diligence should be made to not breed dogs with those issues if at all possible. (sometimes certain things are in all the lines and can not be avoided but an off setting should be attempted)
Any minor faults should be off-set by the dog that it's being bred to, to attempt to improve the next generation. Any dog that is to be bred should be proven to be correct by a conformation show title which shows multiple judges have deemed him/her worthy. And/or be a real working dog, doing the job he/she was bred to do and have ancestors who also were physically and mentally able to do that job. If the conformation isn't good, it's not likely the dog can run long hours herding sheep. (as an example)
One dog shouldn't be bred too many times as it contributes to a bottle neck in a population. And any faults or health issues, minor though they might be will be carried forward in all the lines. So, breeding in as much diversity, but from healthy, good examples of the breed should be striven for.
To answer your question, I don't think a dog with a poor temperament OR poor conformation should be bred. A good example of the breed should be determined by experts in the breed.