Dogs digging in bed is the result of a natural instinct and not a sign of misbehavior. Nevertheless, a concerned owner can train a dog not to dig in certain areas so long as the dog has its own area in which to dig.
Dog Denning
Dogs digging in bed is actually called denning. In the wild, dogs have the instinct to hide in comfortable, protected areas when they sleep. Outdoors, they may dig a hole in soft ground (such as a garden) in order to create a recessed space in which they can hide from the sight of predators and keep warmer and drier during inclement weather. A den can even keep them cooler in the summer, as it protects them from the harsh sun. In the wild, dogs dig in the ground or into piles of leaves and brush if they can't find a natural place in which to hide.
Indoors, you may find dogs digging into things like blankets and bedspreads without actually creating any holes. If they can't hide under a table, under a couch or in another small alcove of the home, they may try to dig into their owner's bed. If they're invited to sleep with the owner, they may try to burrow underneath blankets and sheets in order to recreate that small, enclosed space they would naturally create in the wild.
Why Owners May Dislike the Behavior
While dogs digging in bed is a natural instinct, the dog owner may not appreciate her bedsheets constantly getting messed up or she may not like dog hair under her sheets. In some cases, particularly if the dog's nails aren't trimmed, the dog may tear holes in the sheets, pillows or even the mattress.
How to Discourage the Behavior
The key to avoiding dogs digging in bed is not to pressure the dog to stop the behavior entirely—after all, it's a natural instinct—but to redirect the behavior. Owners can choose to do this by not allowing the dog in bed at all or keeping careful watch over the dog when he does go on the bed.
The first step in either case is to create a comfortable sleeping area for the dog in which he will be allowed to dig. The ideal area will consist of a dog bed, a pile of blankets or both. (Boxes, open crates and the like can also make good dog dens.) Encourage the dog to sleep or at least rest in this area with treats and praise when he digs there.
If the dog will no longer be allowed on the bed, the owner should close off the bedroom when she's unable to watch over the dog. Otherwise, a firm shout of "No!" when the dog jumps on the bed—repeated as many times as necessary—should help the dog learn that she is no longer allowed on the bed. The same principle can be used if the dog will be allowed on the bed but won't be allowed to dig. The owner should only shout "No!" when the dog begins digging.