Why do tourists come in for so much disdain, implicit and overt?
Perhaps because, as you said, the locals get to feel superior that way. But sometimes tourists also want to feel superior (e.g. when they adopt airs and say things like "The coffee's better at home" while ordering coffee on holiday).
Personally, I don't want to be one of "those people", which is why I read A LOT about the places I'm going to -- e.g. their history, geography, weather, language, special customs, things to do and see (and things NOT to do). I enjoy reading about new places.
I also made a point of admiring the local churches, museums and castles, and enjoying the food. Again, I could see the locals appreciated it.
It reminds me of an anecdote I read once of a Native American who, in the 1920s, made his first journey to New York. His obvious bewilderment at (and admiration for) the buildings and statues attracted attention, and an amused local said "How do you like our city?"
The Native American shook his head and said, "It is marvelous, marvelous. But tell me, sir, how do you like our country?"