I didn't notice if someone else answered this or not - but the scooting is b/c dogs and cats have anal sacs. they are glands on either side of the anal sphinchter (says what?) and they can get blocked and over filled, so the animal will drag the opening ocross a rough surface to open them up and drain them to relieve the pressure and itching that they cause.
if you don't want the dog doing this, then you have to manually empty them yourself or have the vet do it. that can get expensive though b/c they fill up pretty quickly. and the concept likely disgusts you, so just let them drag their ass and enjoy the pitful way they look while doing it.