Generally to keep streets safe to drive on, and pleasant to live near.
In particular, SF receives very little rainfall for most of the year, which means that leaves and debris easily accumulate rather than being washed away at regular intervals.
Drivers also have a tendency to leave parts of their vehicles - like broken glass and plastic/metal shards - behind when they routinely crash into each other, which accumulate on the street. Without regular sweeping, those can pose hazards to other drivers and bicyclists, and risk being washed into the bay via storm drains if not swept.
I have a video from a street I used to live on that might illustrate what happens in between cleanings (you'll have to turn the camera view down to face the curb to see): https://youtu.be/ew4fMB7OIyo?t=8
I think at the time the video was taken the red car had been there a while.
The video is not very high-resolution admittedly, but you can gather how things go. If you'd like, here's a screen grab https://imgur.com/a/YTymus3
> Why the hell does SF need to sweep the streets so much?
It does not. All the way to street sweepers zooming down the street at full speed. All the way to NOT cleaning the street before a major event. All the way to ticketing people for a specific "street sweeping" time period but zooming down the middle of the street hours later when parked cars are back. San Francisco street and sidewalks are disgusting and it's their normal condition.
What it is, is a convenient way to write lots of tickets in not much time - as mentioned all over this discussion.
Why the hell does SF need to sweep the streets so much?