The reason why dogs paw at the floor before lying down is due to instinct.
The pawing at the floor before the dog lays down is a result of a dogs natural instinctual behavior from the dogs wild ancestors, and they do the pawing at the floor before laying down to create a safe and more comfortable nesting spot.
A dogs natural instinct before lying down often also includes the dog fluffing their bedding, marking their territory with scent from their paw glands and removing any debris.
A dog pawing at the floor before they lay down also can be a way of the dog regulating their own body temperature or from a maternal nesting instinct.
The dog pawing at the floor before lying down is also a primitive instinct for the dog to make sure there are not things such as spiders or snakes in the grass before they lay down.
Even though they do it inside the house it's just an instinct that is ingrained in dogs as a natural behavior.
A dog may also scratch at furniture such as a couch or chair before they lay down as a natural instinctual behavior, which is inherited from the dogs ancestors to also create a nice comfortable nest.
Other reasons for the dog scratching at a couch or furniture before laying down can be to add their scent marking to claim territory, adjusting the surface for better comfort and a way of the dog regulating their body temperature.
It can also be a result of boredom, anxiety or even stress, especially if it's excessive.