(I'm not sure if the director intended the following, but it's a possible interpretation.)
In the novel All Quiet on the Western Front, Detering sees a cherry tree in bloom and it reminds him of his home on the farm. He picks a branch from the tree to keep it near him. Paul realizes that Detering is being lured by his intense desire to return home, so he tells Detering not to do anything silly. Two mornings later, Detering is gone.
It is possible that the reference to the cherry tree may have been changed to an apple tree to allude to the Biblical symbolism of the apple as "forbidden fruit." Detering is lured away by that which is forbidden--he desperately wants to go home, but the soldiers cannot just freely leave their duty. Once Detering gets his hand on the fruit, he is compelled to run away and follow his desire to go home. For this, he is punished--the guards catch him, and his friends never hear from him again (the reader assumes that Detering has either been jailed or killed). So, Detering is punished for his sin of acting on temptation.