Mr. Samsa's actions show us that he no longer regards Gregor as his son. All he sees before him is a giant insect creature that creeps him out whenever he lays eyes on him. To Mr. Samsa, Gregor is now a threat, a real and present danger to his family. As such, he must be put firmly in his place at every opportunity.
When Gregor's mother looks at his revolting appearance, she faints with the shock. Instead of trying to ascertain what's happened, Mr. Samsa automatically assumes that Gregor must've attacked her. Feeling scared of what his son has become, Mr. Samsa attacks him with the nearest thing to hand: apples. This way he doesn't have to get too close to the hideous creature.
Nonetheless, the apples still hurt Gregor, both emotionally and physically. One of them lodges painfully in his back and he's unable to remove it. For the first time since his grotesque transformation, Gregor now sees himself as others see him. He now understands that he has effectively been exiled from his own home, just as Adam and Eve were exiled from Paradise after defying God by eating the forbidden fruit, commonly represented as apples. Therein lies the symbolism of the apple thrown at Gregor.
In the story, Gregor's father throws apples at Gregor because he sees Gregor as a threat. Gregor concludes that his father has badly misinterpreted Grete's words and is acting according to his distorted perspective of the situation.
Basically, Gregor's father thinks that Gregor must have tried to attack his mother. In reality, Gregor's mother fainted because she was horrified by her son's unnatural appearance. Gregor's father does not try to uncover the truth; instead, he corners his son and eventually attacks him by pelting him with apples from the fruit bowl.
Although Gregor manages to evade most of the apples thrown at him, one becomes lodged in his back. This causes Gregor great physical pain and the wound eventually becomes infected. The infection weakens his entire body, and this leads to Gregor's physical deterioration.
The throwing of the apples symbolizes the discarding of all conventions of civility. Because Gregor's metamorphosis has rendered him a hideous spectacle to human sight, Gregor's father now has the perfect excuse to treat his son cruelly. Before Gregor's transformation, the estrangement between Gregor and his father had always remained latent. After Gregor's metamorphosis, however, the usual rules of cordiality no longer apply.
In fact, no one in Gregor's family makes any attempt to assuage Gregor's injury. The apple remains lodged in Gregor's back, and he becomes a pariah to his own family. The throwing of the apples reinforce the limitations of human civility and tolerance.
Grigor's father does not throw apples to Gregor, but at him. This is not only because he is repelled by him, but because he starts to think of him as being actively dangerous. This is after Gregor has inadvertently succeeded into scaring his mother into a faint, when she and his sister went into his room to start clearing out his things. Gregor's father has shown himself unsympathetic to Gregor from the first - even when he was still in human form, and doubly so once he takes on his new monstrous appearance. He instantly assumes the worst when he finds his wife in a fainting fit and despite Grete's pleas, does not hesitate to start pelting Gregor with apples. In fact, he has already been knocking Gregor about before this incident.
The apple has often been associated with symbolic meaning. Going back to the story told in Genesis in the Bible, when Adam and Eve ate the apple of knowledge and lost their primal innocence, it has often been used as a somewhat negative symbol: of guilt, sin and suffering, even although on the face of it it is a rich and tempting fruit. It is when his father flings these apples at him, trying to actually hurt him (and succeeding) that the irrevocable change in Gregor's situation really hits home, in this scene of violence and chaos. He has most unintentionally scared his mother and his father is now attacking him. Grete alone still appears as an ally but she too will eventually repudiate him. Moreover, one of the apples injures him quite seriously when lodging in his back. From this point on, he is less able to function physically; he can no longer do much for himself. It marks the start of his long decline which results in his inevitable death.
Let me first give the quote:
"An apple thrown without much force glanced against Gregor's back and slid off without doing any harm. Another one however, immediately following it, hit squarely and lodged in his back; Gregor wanted to drag himself away, as if he could remove the surprising, the incredible pain by changing his position; but he felt as if nailed to the spot and spread himself out, all his senses in confusion."
Gregor's father threw the apple at him, because he was disgusted. There was a level of repulsion at what Gregor had become. Even before this event, this is made clear in the book. Gregor's father hit him with a newspaper and walking stick. What make this situation worse is that Gregor was actually the breadwinner. He was the one who kept the family afloat and yet they treated him with disdain.
In addition, it is worth mentioning that Gregor did nothing afterwards with the apple. It just festered in his back. This shows that Gregor is simply willing to take his lot.