Dogs scratch the floor before lying down as a natural instinct. This behavior can help them create a comfortable space to rest, regulate their body temperature, and release their scent to mark their territory.