From the HBO series Deadwood web site:
Rumor has it that the tradition of spreading saw dust on the floors of bars/saloons started in Deadwood due to the amount of gold dust that would fall on the floor. The saw dust was used to hide the fallen gold dust and was swept up at the end of the night.