In all likelihood, the property would have gone to Stanley. Keep in mind that Warden Walker and her family owned the remains of the town of Green Lake, which had become a ghost town in the 20 years between Kissin' Kate's crimes and her death. The books likely take place in the year of the release. In all likelihood, the state owned the lake proper, and thus the lake bed, even if Trout bought all the buildings as the town population dwindled. In all likelihood, the loot was abandoned property on public land (the dried lakebed). As such, it was Hector and Zeroni opperating on their own, who discovered the treasure and thus would be able to claim it as their property. As we do not see the deed to the land, this is an assumption. However, the lack of any fencing around a juvenile detention facility probably hints that they were operating on land that the camp could not legally fence off and used the threat of dehydration to deter escape.
If it was on the property, there might be a legal dispute as it was stolen property in the first place and the estate of Stanley Yelnats would be able to make a claim against Warden Walker that they need to return the goods that were not theirs. This is complicated by the fact that Warden Walker and her employees are knowingly violating the law by using Juvenile Offenders as unpaid labor, despite the fact that they are private state contractors and advertise themselves as a counseling service and are engaging in computer crimes to cover up two offenders running off into the desert as well as fraud. This results in the state seizing control of the facility to properly dispose of those in it's custody and the property itself. This means that even if Warden Walker rightly owned the land, the state felt it like it was in everyone's interest to back the Yelnats' claim to the contents of the chest (In all likelihood, they could have included it as a settlement to prevent a lawsuit as the state would be a party to any case (at the least, they failed to properly inspect the facility and it's operations) and the Yelnats and Zeroni's are the victims who were impacted the most. It could also have been used to incentivize or thank them for testimony against the Walker operation.).
It could also be the case that the book ended prior to the treasurer's ownership being rightfully decided by the law. The Yelnats were independently wealthy thanks to Yelnats III's discovery of a cure for foot oder (Sploosh), which was so successful that they were able to advertise it with a Superbowl commercial with a celebrity endorsement from a Major League Baseball player no less. While the baseball player likely was doing it at a significant discount because his testimony lead to Yelnats IV's wrongful conviction and abuse at Camp Green Lake, the price for a 30 second spot in Super Bowl XXXIII (1999) was $1.6 million dollars and was likely payed for from (Sploosh's) own income as an advertising expense is nothing to sneeze at.
It should also be pointed out that Holes is not a story about the law (this comes as early as Stanley IV's trial, where he is not given an lawyer and his family cannot afford one, along with some testimony that would not have been allowed being allowed to be heard.). The point of the treasure being found was symbolic of the family curse being lifted, a result of Stanley carrying Zero up the mount where they found water, and allowing him to drink while he sang the fabled song (The terms that Stanley's No good pig stealing Great-Great-Grandfather failed to oblige to Hector "Zero" Zeroni's Great-Great-Grandmother that brought the curse upon the family.). As a major theme of the book is the choices of the past affecting the present, the treasure is a symbolic victory. Stanley IV is rewarded for fulfilling his ancestor's promise out of the goodness of his own heart and no idea that he was doing this. When Zero reveal his real name as Zeroni, Stanley has no idea of the relation to the gypsy woman who cursed his family (if I recall the book spells it out for the reader. I remember in my first read, I forgot Madam Zeroni's name by the time we learn it's Zero's name.). As such, the legality of do they own it because it was stolen and their name was on it wasn't considered. Green Lake is also recieves the first rain it has in 100 years after the treasure is found and Zero is taken with Stanley's lawyers out of Green Lake (it's implied that Sam, Kissin' Kate's lover, whose death at the hands of the towns folk brought about the cursed drought, had also been broken.).