The curse of a witch to punish Elya Yelnats. So Stanley's family all believed their bad lucks were all because of the great-great grandfather. There is also another two curses which was mentioned through P95-139. Hattie Parker saw Miss Katherine and Sam kissed, so Katherine cursed him "God will punish you!" In another occasion, sheriff cursed Miss Katherine because she did't kiss him: "The law will punish Sam and God will punish you."
It's obvious that Elya Yelnats didn't believe the curse. But the curse will come true sooner or late.
I think the Warden believed the curses, that's why she convinced people to dig.
For Stanley himself, he believed the curse. So he really hate his grand-father. He also showed great excited on the mountain which the shape of it just like a thumb, because he thinks his grandfather was caught at the top of that mountain.