I agree, 100%, with everything you've written - with the exception of the first sentence.
I make the comparison not because of what the law does, which is, beyond any doubt, necessary to society (the law and opposable thumbs are the only things that separate us from other animals). Rather, I make the comparison because, with very few exceptions (e.g., adoptions), an attorney makes his living off of the misfortunes, disputes, and petty squabbles of other people. Like garbage, these are things that happen as a natural result of the nature of humanity; yet, like garbage, they also stink. Which is why I think of legal disputes as "social refuse" - be they civil or criminal, these disputes are unavoidable, someone has to deal with them, but at the end of the day, you're covered in the filth of that with which you deal.
I don't mean this comparison as derogatory - to either garbagemen or attorneys. They're jobs that, if we want to live in a society that doesn't have crap on the streets or daily Hatfield-McCoy occurrences, have to be done.
It's merely an observation on the nature of the business.
Nothing you do stops the garbage from accumulating, but you can make lives better for people, and for society as a whole, by helping to remove it. Yet, there are people who don't want anything to do with you because they think you stink; and even when you go home to take a shower, you know you're just going to stink again the next evening.
You do it either because you're paid to do it, because you enjoy doing it, or because you recognize the value in what you're doing. But what you're dealing with still smells bad, and there are days where you wonder, "isn't there a job that doesn't involve rotten vegetables and spoiled milk, or horribly mangled bodies and unreasonable people."