This expression comes from one of Aesop's fables. A fox was trying very hard to reach a bunch of grapes which he saw hanging over a garden wall just out of reach. He kept jumping up and down, snapping at the grapes and reaching out with his paws. In the end he realised it was hopeless and gave up; but he didn't want to admit that he couldn't reach the grapes, so as he walked away he shouted over his shoulder, "who wants to eat you anyway? You're sour!" We still say "sour grapes" to indicate that someone is just pretending to despise something because they know they can't have it. A modern-day example might be sneering at a friend's expensive new car, which you know you couldn't afford yourself; or if you weren't invited to a particular party, pretending that you didn't want to go anyway. Everyone is guilty of sour grapes at some point.
They use the term Sour Grapes in Twilight when Jessica wanted Edward, but he didnt like her so she had a "clear case of sour grapes"