C-3PO is programmed for etiquette and is able to communicate with all sorts of life forms and even technology (eg the Millennium Falcon) and he is generally very respectful to all biological characters. Except Chewbacca! Why is this acceptable? Do other species look down on Wookiees (apart from Imperials)? E.g. "He's only a Wookiee!" "I thought that hairy beast would be the end of me."
It might not be "okay" for C-3PO to disrespect Chewbacca, but it isn't particularly unusual in the context of the group in which they find themselves. Almost everyone says disrespectful things about almost everyone else in the group. Only Luke is never seriously insulted or mocked1.
As the previous answers have pointed out, C-3PO does seem to look down on all non-droids. It is also worth mentioning that in some Star Wars materials, Wookiees are a slave race, treated as subhumans by most people. In the game Star Wars: Knights of the Old Republic, there are several missions on Kashyyk, where you basically have to liberate the planet from the slave traders.
However, I think there is more to the 3PO/Chewbacca dynamic than has been said here so far. When 3PO first meets Chewbacca, he is much more respectful than he is later. The first real interaction between them is when R2-D2 is playing the holographic chess game with Chewbacca. R2 is winning, and Chewbacca is getting annoyed:
[R2-D2 and Chewbacca are playing the holographic game aboard the Millennium Falcon]
C-3PO: He made a fair move. Screaming about it can't help you.
Han Solo: Let him have it. It's not wise to upset a Wookiee.
C-3PO: But sir, nobody worries about upsetting a droid.
Han Solo: That's 'cause droids don't pull people's arms out of their sockets when they lose. Wookiees are known to do that.
C-3PO: I see your point, sir. I suggest a new strategy, R2: let the Wookiee win.
C-3PO is totally willing to defer to the Wookiee here. It is only as he becomes more comfortable around his new companions that he takes part in the bickering and squabbling.
C-3PO and Chewbacca don't interact much for the rest of the first movie, but in The Empire Strikes Back, Chewie saves 3PO from being melted down on Bespin. He clearly cares about the droid, and is quite obviously upset to see him shut down and in pieces. He immediately sets about trying to fix him. When 3PO comes back online, he is grateful to Chewbacca, until he notices that the Wookiee has inadvertently put his head on backwards. He starts griping, and Chewie shuts him down again.
Later, 3PO is turned on again, and Chewie is carrying him around on his back. 3PO is agitated because of his predicament, and scolds Chewbacca several times. This isn't indicative of a lack of respect so much as it is a reflection of 3PO's personality - he is a scaredy cat, and Chewie is attracting blaster fire while 3PO is in the line of fire and incapable of avoiding the blasts. 3PO isn't used to this kind of situation, and his natural reaction is to say "Stop doing things that make people want to shoot you!"
This is what is going on in the carbon freezing chamber. Chewbacca is bound to Han by a life-debt, something that Wookiees take very seriously, and he probably believes that he is obligated to do whatever it takes to keep Han safe - even if it means that he, Chewbacca, will die in the process. Chewie is okay with this, because he firmly believes in the sacred bonds of the life-debt. C-3PO, on the other hand, is literally tied to Chewie's back, and whatever happens to the Wookiee will happen to him as well, whether he likes it or not.
I think we can forgive 3PO for loudly objecting to Chewbacca's course of action, since 3PO isn't bound by a life-debt and has no interest in dying pointlessly. The droid might be a bit insulting to Chewbacca at this point, but you would be too, if you were in a bag on the back of a giant ape who was determined to get himself blown to pieces in a futile attempt to save his friend.
When Lando has his moment of clarity, so to speak, and decides to help Leia and Chewbacca save Han, Leia and Chewie are understandably reluctant to trust him. Chewbacca attacks Lando, Leia shows her support for this tactic, and 3PO is mortified. He is, after all, a sort of diplomat; his job is to translate for the purposes of diplomatic relations. He is naturally inclined to trust people, especially when trusting them is the most logical and mutually beneficial option.
Therefore, while Chewbacca is strangling Lando to death, and Leia is gleefully egging him on, 3PO is the only one who is emotionally objective enough to see the value of giving Lando the benefit of the doubt. So, when Chewbacca finally relents and lets Lando go, it is in 3PO's nature to try to smooth the waters a bit and apologize for Chewbacca's rash behavior. "After all, he's only a Wookiee".
Moments later, as the group is fleeing Cloud City, 3PO goes back to griping about Chewbacca's actions. He alerts Chewbacca to threats from behind, which is helpful, although he is more concerned about getting shot himself than he is about the possibility of Chewbacca being shot from behind. Then he complains about Chewbacca's clumsiness, because Chewie forgets that he's carrying a droid on his back, and repeatedly smacks 3PO's head into the doorway of the Millennium Falcon.
Does C-3PO give Chewbacca a hard time on occasion? Certainly. But is he alone in doing so? Absolutely not.
Shortly after Leia is rescued, the group is making its way through the Death Star:
Princess Leia Organa: [Pushing past Chewbacca] Will someone get this big walking carpet out of my way?
When Leia blasts open the garbage chute, then jumps in, Han tells Chewie to follow her. The Wookiee sniffs the chute, shakes his head "no", and growls. Han says:
Han Solo: Get in there, you big furry oaf! I don't care what you smell! [Kicks Chewbacca in the butt, sending him tumbling down the chute]
When Han suggests that Leia loves him, Leia replies, "I don't know where you get your delusions, Laser-brain." Chewbacca finds it hilarious and laughs in Han's face:
Han Solo: Laugh it up, fuzzball!
When Han is trying to leave Hoth:
Han Solo: Afraid I was gonna leave without giving you a goodbye kiss?
Princess Leia: I'd just as soon kiss a Wookiee.
But before you start to think that Chewbacca is unfairly targeted for abuse, it needs to be said that everyone gets their share of jibes, and the most frequent target is probably Han. For example:
Princess Leia: Why, you stuck up, half-witted, scruffy-looking Nerf herder.
And when C-3PO is dishing it out, he's usually aiming his blasters at R2-D2:
C-3PO: Don’t call me a mindless philosopher, you overweight glob of grease!
C-3PO: You’ll be malfunctioning within a day, you nearsighted scrap pile.
R2-D2: [Beeps an inquiry]
C-3PO: No, I don't think he [Luke] likes you at all.
R2-D2: [beeps again]
C-3PO: No, I don't like you either.
It is a normal part of this group's dynamic to make fun of each other and sling insults back and forth. Han rags on Chewbacca, C-3PO, and Leia. Leia gives a hard time to Chewbacca and 3PO. C-3PO mocks R2-D2 and Chewie. R2-D2 beeps his insults at anyone who will listen, but primarily focuses his derision on 3PO (and of course, he gets in a fight with Yoda on Dagobah). Chewbacca occasionally rips on Han, and possibly C-3PO at times, although we don't know what he's saying. Only Luke seems to be above the fray.
For the most part, it appears that this is just the way the group works. They are in almost constant danger, and it is natural and healthy for them to lighten the mood by poking fun at one another.
1 After Obi Wan dies, at least. While Obi Wan was alive, Han was pretty dismissive of The Force in general and Obi Wan in particular, and he gently teased Luke about his willingness to believe Obi Wan's stories and try to use the Force. After Obi Wan was killed, however, Han became much more respectful, and none of Luke's friends made fun of him from then on, aside from Han's statement upon waking up from his carbonite nap - "Luke? Luke's crazy! He can't even take care of himself, much less rescue anybody. A Jedi Knight? Jeez, I'm out of it for a little while, everyone gets delusions of grandeur!"
I don’t disagree with you that there is a bit of a dissonance there, and I suspect that more than anything, it was just for comic relief.
That being said, as a protocol droid, it was his job to help his owners in matters of communication and etiquette, whether with other biological species (assuming the owner was biological), or with machines such as droids, though this doesn’t mean that he was perfect at his job or that there weren’t scenarios where there were tradeoffs between being polite and telling the truth to facilitate 'human-cyborg’ relations.
Whether or not Wookiees were generally well-known in the galaxy at the time wouldn’t necessarily impact C-3PO. Wookiees had been known about for a very long time (since after circa 3996 BBY, after the Great Sith War, when the planet, Kashyyyk, was discovered by the Czerka Corporation). And protocol droids were very well 'educated’ in their programming, so whatever ignorance may have abounded, there is no reason to suspect that C-3PO would have been subject to it.
His comment about "He’s only a Wookiee" is not really insulting when you consider the context. Protocol droids were taught not only language and etiquette but also customs and cultures. Wookiees were well known for being fearsome warriors and that
their tempers were fiery, and an infuriated Wookiee could erupt in a fit of berserker rage that only ceased when the source of their anger was damaged enough to their satisfaction. - from http://starwars.wikia.com/wiki/Wookiee#Combat_and_war
At the time of the comment, in TESB:
Lando had betrayed Chewie and his friends
Chewie’s best friend (whom he owed a life debt to) Han Solo was then tortured by Vader
Han was then frozen in carbonite and shipped off with Boba Fett to be delivered to Jabba
So both Chewie’s anger and C-3PO’s remark that Wookiees were prone to such fits is reasonable in the context. In addition, Chewie had only half put C-3PO back together at the time, which had upset him (though perhaps he should be more grateful for Chewie finding him and at least trying to repair him.)
The comment about “I thought that hairy beast would be the end of me” was just after he had been shot at repeatedly and had his head banged into the ship.
Although protocol droids were supposed to be polite to their owners, that isn’t to say that they always were/had to be polite in their spare time, or that they didn’t have individual personalities that responded negatively to stressful situations. They were designed to ‘evolve’ with experience, and as they were also designed to mimic their owners and learn, some of them may well learn the difference between how you behave at work and how you behave when you are not at work.
C-3PO often made snarky off-handed comments to, and directed towards, his long-time companion, R2D2 as you often see in the movies and throughout the canon; this is from his Wookieepedia page.
C-3PO was rather polite and quirky towards his companions, especially R2-D2, although he could be sarcastic and indignant when mistreated by individuals like Jabba the Hutt.
He doesn’t just make sassy comments about Wookiees, he also makes them about others, for instance in ANH:
I can’t abide these Jawas. Disgusting creatures.
At the time Luke Skywalker was his owner, so technically he only really had to be polite to/for him and help him in his interactions with others, yet he even had a little bit of (indirect) sass for his own master, in TESB (when Luke is missing and Han is out looking for him):
(to R2D2) Don’t worry about Master Luke. I’m sure he’ll be all right. He’s quite clever, you know … for a human being.
N.B. A possibly related, though not entirely on-topic, post can be found here.
It strikes me that C-3PO's treatment of Chewbacca is no more disrespectful than anyone else's, and is entirely what you would expect from a droid full of cultural sensitivity: he successfully assesses the culturally correct way to interact with a "Wookiee that is on our team", and imitates and perfects it.
Simple as that, isn't it?
It may possibly be the fact that Wookiees are generally misunderstood creatures. I'm still searching for the source but I do believe Wookiees are generally new to the Galactic scene. Meaning their species has only been "in space" for a relatively short period of time when you put them against other races.