Mark Thoma's meditation on why people dislike economists is an interesting read. My sense is that it's simpler than all that: Folks don't appreciate having their pain dismissed as meaningless static that muddles a more important aggregate picture. That doesn't mean their pain isn't mere noise, but no one likes blithe dismissals predicated on impenetrable models. Economists who express great confidence in their answers are going to be unpopular among populations that don't like those answers. It's to be expected. There are, of course, more serious critiques of contemporary economics, many of them made by renegade economists and observers frustrated by the discipline's inattention to political realities, but I think they're different than what Mark is talking about.
Also, Mark's wrong to suggest that the economics profession has been speaking with one voice, or anything like it, in favor of a seriously expanded social safety net. Mark Thoma has certainly advocated for such redistribution, as have Paul Krugman, Lawrence Summers, and many others. Glenn Hubbard, Gregory Mankiw, and quite a number in their conservative cohort have done no such thing, however. And economists often react with fear and suspicion when their colleagues turn attention towards the downsides of globalization.
That said, I don't think economists are poorly treated by the public at large. I think they are better treated than any single profession I can think of.