Hawthorne's story is a parable, like those told by Jesus in the New Testament. The easiest way to explain the theme of "The Ambitious Guest" is by quoting from the great German philosopher Arthur Schopenhauer.
Of course, as Schiller says, we are all born in Arcadia; in other words, we come into the world full of claims to happiness and pleasure and cherish the foolish hope of making them good. As a rule, however, fate soon comes along, seizes us harshly and roughly, and teaches us that nothing belongs to us but everything to it, since it has the undisputed right not only to all our possessions and acquisitions, to wife and family, but even to our arms and legs, our eyes and ears, and to the very nose in the middle of our face. In any case, experience after a time teaches us that happiness and pleasure are a fata Morgana which is visible only from a distance and vanishes when we approach it. On the other hand, we are taught that suffering and pain are real which immediately make themselves felt and need no illusion or expectation. Now if this teaching bears fruit, we cease to run after happiness and pleasure, but rather are we more concerned to bar as much as possible the way to pain and suffering. We then recognize that the best the world has to offer is a painless, quiet, and tolerable existence to which we restrict our claims in order to be the more certain of making them good. For the surest way not to become very unhappy is for us not to expect to be very happy.
The setting of Hawthorne's story and the characters presented in it are a microcosm of the human race and its tragic condition. Everyone has dreams of achieving happiness in the future, but everyone is subject to death which will erase everything they may have achieved. The mountain hurling big rocks at the flimsy cabin is a symbol of all the misfortunes that can spoil our plans, including sickness, war, natural disasters, economic depressions, and all kinds of serious accidents.
Here is a quote from Sam Spade's story about a man named Flitcraft, who abandoned his wife and family and acquired a new identity and a new family after nearly being killed by a falling girder, in Dashiell Hammett's mystery novel The Maltese Falcon.
Flitcraft had been a good citizen and a good husband and father, not by any outer compulsion, but simply because he was a man who was most comfortable in step with his surroundings....But a falling beam had shown him that life was fundamnetally none of these things. He, the good citizen-husband-father, could be wiped out between office and restaurant by the accident of a falling beam. He knew then that men died at haphazard like that, and lived only while blind chance spared them.
The family living in the Notch has been surviving only while blind chance spares them--and then blind chance buries all of them, including their ambitious young guest, in a spectacular landslide.
The implicit moral of "The Ambitious Guest" seems to be the same as the advice offered by Schopenhauer in the above quotation. We should acquire humility and recognize that "the best the world has to offer is a painless, quiet, and tolerable existence to which we [should] restrict our claims in order to be the more certain of making them good." This attitude may seem pessimistic and even atheistic, but it is in line with the teachings of both Jesus and Buddha, as well as the teachings of Schopenhauer and many other famous philosophers.