Not all dogs that bite are euthanaised. When they are, there are two reasons it happens - owner decision (sometimes with a bit of encouragement from the police), or court order.
The courts only really tend to get involved when it's a dog that has done serious damage. They don't tend to get involved for a nip.
Dogs bite for all sorts of reasons, and whether or not they present an ongoing danger is hugely context dependent. Mouthing is a completely normal stage of puppy development, and sometimes they accidentally draw blood. A large proportion of family dogs will snap and possibly bite if startled awake (hence the saying "let sleeping dogs lie"). If someone walks up to a dog and kicks them, frankly they deserve to be bitten. A dog with resource guarding issues might be safe enough with a dog savvy adult household but dangerous in a household with young children. A dog with issues around visitors can be fantastic with the owners but a danger to visitors, and in such circumstances people often just don't have visitors at all.
Most dogs with behaviour issues, including those that have bitten, can make vast improvements with help from a clinical animal behaviourist and a suitably committed, sensible owner.
There are a small number of dogs who are so psychologically damaged that they are genuinely dangerous and can't be helped to an adequate extent by a behaviourist, but this is a small minority of the dogs with a bite history.