A better question is why do people who spit, do it where people walk. I spit quite often because of a habitual propensity which grew out of a necessity when I was going through Chemo. The chemicals which would drain into my mouth amid the saliva were unbearable.
However, I spit into storm drains, trash cans and dirt filled planters and tree boxes on the sidewalk. I never spit on the sidewalk and where people could see it or walk on it. As well, I also am not spitting out "gobs". It is generally just clear watery saliva that to this day excessively drains into my mouth...since the treatment.
People spit on sidewalks and walkways because they either do not realize they are being disrespectful, or they just don't care who walks on it.