I always thought it had to do with identification of specific dogs. They obviously smell different, therefore their butts probably smell different, as does their pee. I know when I take my little guy for a walk, he stops at every likely spot to see who peed there and what it smells like. I call this reading his pee-mail.