The term "meatbag" is used by robots (including Bender, from Futurama, and HK-47 from the Knights of the Old Republic games) as a pejorative term for a human or other creature. Where did this term first appear in any media?
The earliest robot I can find saying this is Bender, from Futurama.
In his debut scene, in the pilot episode of the show, he calls Fry a meatbag.
Here's the excerpt from the script for this episode which originally aired on March 28th, 1999.
Bite my shiny metal ass.
[Fry looks around at the robot's ass.]
It doesn't look so shiny to me.
Shinier than yours, meatbag!
The "ROBOT" is Bender, before his name is revealed.
This predates Star Wars: Knights of the Old Republic by about four years, where the droid HK-47 famously uses the term.
There are certainly other times when it's been used in science fiction and fantasy and pop culture, though not necessarily by robots.
For instance, in the 1989 novel Dydeetown World by F. Paul Wilson, it's used by a character referring to a clone:
His upper lip curled. "Meatbag clone... Too stupid to know."
And it's used in the 1976 film Rocky:
... The Rock's a good kid.
... A meatbag.
1974 in English, 1965 in Polish - By the robots of the Cyberiad
According to TV Tropes,
Robots in the Cyberiad usually call humans "palefaces", but occasional "meatbag" still appears here and there.
first published in 1965, with an English translation appearing in 1974
I know of two earlier instances of non-biological intelligences taking this attitude toward biological intelligences:
Terry Bisson's short story "They're Made out of Meat", originally published in Omni in 1990, involves extraterrestrial life forms who are absolutely horrified by the notion of a race of thinking beings composed entirely of meat. (It's strongly implied that this is us.) The exact nature of the ETs is not clearly specified; they probably aren't robots in the strict sense.
The System Shock video game series (first installment 1994) features an artificial intelligence, SHODAN, whose opinion of humans is famously quotable:
Look at you, hacker. A pathetic creature of meat and bone, panting and sweating as you run through my corridors. How can you challenge a perfect, immortal machine?
Neither of these uses the exact term "meatbag", but I think it is likely that the authors of both Futurama and Knights of the Old Republic were familiar with them; and, indeed, that the authors of System Shock had read the Terry Bisson story. It's hard to overstate how influential Omni was throughout the 1980s and early 1990s, especially to the sorts of people who would go on to write SF themselves.
Going back further, it's not the same attitude, but it's in the same line of speculation: Harlan Ellison's infamous I Have No Mouth, and I Must Scream, published 1967:
AM could not wander, AM could not wonder, AM could not belong. He could merely be. And so, with the innate loathing that all machines had always held for the weak, soft creatures who had built them, he had sought revenge.
This example is later than many of the others posted above but earlier than Futurama so I wanted to add it to the list: in the 1988 video game Snatcher (a pretty cool Blade Runner rip-off, with a little stolen from The Terminator), one of the cyborg creatures refers to the main character (a human) as a "meatbag".