It means when someone can't gain something/someone s/he likes, s/he will say that stuff is not that good or that person is not so perfect.
That's just sour grapes!
sour grapes: saying or pretending that something is not worthhaveing
because one cannot obtain it.
http://zhidao.baidu.com/question/148440174.html