While media companies frequently tell consumers that palm oil is directly leading to an environmental crisis and killing orangutans, the answer is not just "yes." Some even state, “Halloween candy is killing the orangutans,” directly linking candy to orangutans dying, but it just isn’t that simple.
In reality, palm oil is the most efficient oil crop on the planet. It accounts for 36% of the world's vegetable oil while using less than 9% of the global land dedicated to oil crops. The efficiency of the oil palm, the tree that grows palm oil, vastly outperforms other alternatives like soybean, sunflower, or coconut oil.
Forcing candy companies to not use palm oil wouldn't save rainforests or keep all the orangutans alive; it would require more land and promote more deforestation. By not using palm oil, more orangutans are destined to die.
Source: Hannah Ritchie and Max Roser, "Palm Oil," Our World in Data