When a dog scratches at the floor, he is claiming that spot as his own.
The bottom of a dog's paws has special glands that release a territorial scent onto the floor when the dog scratches.
The odor lets other dogs know that they need to keep moving because the scented spot has already been claimed.