Why was Stanley Yelnats' family cursed in Holes?
Stanley Yelnats is arrested for a crime he did not commit. His family blames their bad luck on the person they refer to as "Stanley's no-good-dirty-rotten-pig-stealing-great-great-grandfather" (page 7). Stanley's great-great grandfather stole a pig from a one-legged gypsy who cursed the entire family. His great-great grandfather was a man named Elya Yelnats from Lithuania. He wanted to marry a young girl named Myra Menke, but Myra's father wanted to marry her to Igor Barkov, who offered the father a fat pig in exchange. Elya sought help from Madame Zeroni, an old Egyptian woman who gave him a pig in exchange for his promise to carry her up the mountain so she could drink from a stream and hear his song. Elya wound up not marrying Myra, and he went to America as a deck hand, forgetting his promise to the gypsy.
As a result, the family always seems to be in the wrong place at the wrong time and never has any luck. Stanley's father, for example, is an inventor, and though he is intelligent and diligent, he never experiences any luck. His inventions never work out, and the Yelnats are poor.
There are several stories being told in parallel in the book and one of them is the story of Stanley's great-great-grandfather Elya Yelnats. He is the one who is blamed for the generations-long curse that has affected the family and prevented them from ever being successful.
The story is that he went to a woman in Latvia named Madame Zeroni for advice. She also gave him a pig which helped him on his way to success but her price for her help was that Elya carry her to the top of a nearby mountain. Elya took her advice and after finding success, he quickly forgot about his promise and never did carry Madame Zeroni to the top of the mountain. So she laid a curse on the family that constantly caused them to have bad luck.