The commercial spacecraft Nostromo is on a return trip to Earth with a seven-member crew in stasis: Captain Dallas, Executive Officer Kane, Navigator Lambert, Science Officer Ash, Warrant Officer Ripley, and Engineers Parker and Brett. Detecting a mysterious transmission, possibly a distress signal, from a nearby planetoid, the ship's computer, MUTHR, awakens the crew. Following standard company policy for such situations, the Nostromo lands on the planetoid and Dallas, Kane, and Lambert head out to investigate, damaging their ship upon landing in dust. They discover the signal is coming from a derelict alien spacecraft. Inside, they find the remains of a large alien creature whose ribcage appears to have exploded from the inside.
On the Nostromo, Ripley determines that the transmission is not a distress signal but a warning. In the alien ship, Kane discovers a chamber containing hundreds of eggs. As he inspects one, a creature springs out, spits acid through his space helmet and attaches itself to his face. Dallas and Lambert carry the unconscious Kane back to the Nostromo. As acting senior officer, Ripley refuses to let them aboard, citing quarantine regulations, but Ash violates protocol by overriding Ripley's lock and letting them in. The crew are unable to remove the creature from Kane's face, as its grip is strong and its blood is an extremely corrosive acid. It eventually lets go, crawls away, and dies.
The crew repair the ship and lift off. Kane awakens and seems healthy, but during the crew's final meal before re-entering stasis, he chokes and convulses in pain before a small alien creature bursts from his chest, killing him, and escapes into the depths of the ship to molt. Since attacking the creature with conventional weapons could result in its corrosive blood breaching the ship's hull, the crew attempts to locate and capture it with motion trackers, nets, electric prods, and flamethrowers.
Brett is sent to look for the crew's cat, Jones, and the now fully grown alien attacks him and disappears with his body into the air shafts. After a heated discussion, the group devises a plan to jettison the creature out of the ship. Dallas enters the Nostromo's labyrinthine ventilation shafts, intending to force the alien into an airlock, but it ambushes him. Lambert, realizing the alien is killing the crew one by one, implores the others to escape in the ship's shuttle. Now in command, Ripley explains that the shuttle will not support four people, and recommends that they continue with Dallas' plan of flushing the alien out.
Accessing MUTHR, Ripley discovers that Ash has secretly been ordered to return the alien to the crew's employers, who consider the crew expendable. When Ripley confronts Ash, he tries to choke her to death. Parker intervenes and knocks off Ash's head, revealing him to be an android. Parker reanimates Ash's head, and Ripley interrogates him. They learn he was assigned to the Nostromo to convince the crew to capture the creature and return it for analysis, even at the expense of the human personnel. Ash taunts them about their chances of survival against the "perfect organism." Parker turns a flamethrower on Ash.
Ripley, Lambert and Parker agree to set the Nostromo to self-destruct and escape in the shuttle. However, Parker and Lambert are ambushed and killed by the alien while gathering life-support supplies. Ripley initiates the self-destruct sequence and heads for the shuttle with Jones, but the alien blocks her path. She retreats and unsuccessfully attempts to abort the self-destruct sequence, then returns to retrieve Jones, finding the alien gone. She narrowly escapes in the shuttle as the Nostromo explodes.
As she prepares to enter stasis, Ripley discovers the Alien is aboard the shuttle. She dons a spacesuit and opens the shuttle's airlock, causing explosive decompression which forces the Alien into the shuttle's open doorway. She propels it into space by shooting it with a grappling hook, but the gun catches in the closing door, tethering the alien to the shuttle. Ripley activates the engines, blasting the alien into space. After recording the ship's final log entry, she places herself and Jones into stasis for the voyage home.

Question: Why does the crew set the ship to self-destruct?
Answer: To try and destroy the alien.