From the Oxford dictionary:
sour grapes
used to refer to an attitude in which someone adopts a negative attitude to something because they cannot have it themselves:
government officials dismissed many of the complaints as sour grapes
Is there an equivalent or similar expression in Spanish?