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.
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.