Aladdin

The story begins with a young boy named Aladdin, trying to make money by being a servant for a day, with no success. Meanwhile, a shifty man named Hassim, who has journeyed from Marrakesh, visits the local medicine woman, Fatima, who tells Hassim that in order to reach a certain treasure that he wants, he needs Aladdin. Hassim visits Aladdin and his mother, claiming that he's Aladdin's long lost uncle, and says that he can make them rich beyond their wildest dreams.
The next day, Hassim and Aladdin travel outside the city to the location of the treasure. When they arrive, Hassim begins an incantation to open the cave; Aladdin finds out that Hassim isn't his uncle, and that he only brought Aladdin to this spot because he is the only one that can enter the corridors of a dark cave and claim the treasure inside: an old oil lamp. Aladdin reluctantly steps inside and walks past the traps within, leading him to a beautiful garden with friendly animals. He eventually finds the lamp; he pauses to pick flowers from a tree for his mother, which instantly turn into jewels, so he takes a whole sack full. Aladdin makes it back to Hassim, but fears that he may be killed after Hassim takes the lamp away from him, and so he refuses to give it to him. Enraged, Hassim uses his powers to close the entrance of the cave forever, trapping Aladdin. Aladdin kneels to pray and accidentally rubs the lamp, releasing a powerful genie inside, who can grant any wish. Aladdin wishes that he was out of the cave and back home. Aladdin tries showing his mother the magic lamp, but she fears it is too dangerous and wants him to put the lamp away and remain silent about it.
Cut to four years later, Aladdin and his mother must hide indoors for the sultan and his daughter Layla are being escorted to the bathing house and the sultan orders that no one looks upon his daughter, or the punishment is death. Curious by the sultan's order, Aladdin sneaks out while his mother sleeps. He sneaks into the bathing house and sees Layla from inside, and is immediately entranced by her beauty. The head of the bath house spots Aladdin, and calls on the guards to catch him. Aladdin bravely duels the guards and manages to get away. Later that night, Aladdin tells his mother that he wishes to marry the princess, but she laughs and tells him that a poor boy such as he would find it impossible to marry a princess. Aladdin says that he can marry her with the help of the sack of jewels that he took from the cave, and his mother then agrees to help him. The following morning, as the sultan is granting the wishes of his people, Aladdin's mother goes and asks that Aladdin marries his daughter. The sultan and his court laugh, but Aladdin's mother shows him the jewels and the sultan becomes intrigued. However, the vizier, who plans to have his own son marry the princess, steps in and tries to convince the sultan that his daughter is worth more than one sack full of jewels. The sultan agrees and says that Aladdin must bring to him 80 servants with a chest of jewels in each of their hands. With his mother's consent, Aladdin brings out the lamp and has the genie grant the sultan's request. After seeing this amazing feat, the sultan lets Aladdin marry Layla. Aladdin has the genie build them a palace near the city and he and his new bride begin a very happy life together.
Hassim hears of Aladdin's wedding through Fatima, and realizes that he has used the lamp to become wealthy and powerful. Hassim travels to Aladdin's city, and disguises himself as a seller of new lamps for old. Layla wants to surprise Aladdin with a new lamp while he is on a hunt, and has her servant trade in Aladdin's lamp for another. Hassim takes the lamp, releases the genie, and wishes that Aladdin's wife and palace are brought to Hassim's homeland in Africa. The sultan hears of his daughter's disappearance, and wants Aladdin dead as punishment. However, Fatima - who did not receive her end of the bargain with Hassim - is brought in and explains the situation and reveals Hassim is in his homeland of Marrakesh. Knowing his mother will vouch for his word of honor, Aladdin is granted one month of freedom to save Layla and make things right, or he will return to face the sultan's punishment. After traveling to Africa, he sneaks into the palace and regains the lamp and wishes the palace back to the sultan's kingdom. Upon waking to this, Hassim flees the palace, swearing revenge against Aladdin. Aladdin is welcomed back a hero, and the city rejoices at the announcement that Layla is with child. Aladdin also finally sees to it that his mother is given a life of splendor for keeping his honor.
Before Aladdin can live happily ever after, Hassim kills off Fatima and uses her robes to disguise himself as her. He tries to trick the princess into having Aladdin wish for the egg of the fabled Roc bird, as hanging the egg over their baby's nursery will bring good fortune. The genie is unable to grant the wish as the Roc is his ultimate master, and reveals that Fatima is actually Hassim. Aladdin pretends to be ill and says only the medicine woman's powers can heal him. Hassim sneaks into Aladdin's room and tries to kill him in his sleep, but Aladdin wakes up and duels with Hassim. Hassim backs Aladdin into a corner and charges at him. However, thanks to luck and convenience rather than Aladdin's own skill and effort, Hassim slips on his robe, trips, and stabs himself with his sword, causing him to magically evaporate forever.
Aladdin and the princess then live happily ever after without the fear of anyone stealing the lamp again.

Question: Why did Hassim close the cave?
Answer: Because Aladdin refused to give him the lamp.