Also, there are breeds where their small size and fragility make them a poor choice for small children. No dog should be expected to spend most of it's time in isolation. Puppies especially need a lot of time and attention. Lack of this can result in behavioral problems, even in an adult dog. Sleeping in could mean the dog will sleep in a warm comfortable barn or stable.
Many dogs really take to the job of stable guard and enjoy sleeping in that environment.
For dogs that will sleep outdoors, you still have to provide a house for them, and use judgement. There is a broad range of dogs who can sleep outside, but even in this category there are some which are more naturally hardy than others. This does not mean the dog will necessarily guard the house, attack intruders, etc. Some can be trained for defense, or to subdue an attacker. Police dogs are used as guard dogs, but so are the large dogs used to protect the flock against wild animals.