Considering that Jesus knew that His purpose on earth was to die why was He so distressed here

Scriptures teach that Jesus had looked ahead to this hour (CP Jn 2:4; 7:30; 8:20; 12:23,27; 13:1). But now, as the time drew near Jesus dreaded it (CP Mk 14:3236; Lu 22:41 -44). Jesus' anguish had nothing to do with the fear of man or the physical torments of the cross, for He had resolutely set Himself to die (CP Isa 50:6-7; Mt 20:28; Mk 10:32-34, 45; Lu 9:51; Jn 12:24,27). Our Lord was sorrowful because within hours the full cup of divine fury against sin would be His to drink; He would bear the punishment for sin by being separated from God (CP Isa 53:10-12 with Psa 22:1; Mt 27:45-46; Mk 15:33-34; 2Cor 5:21). See also comments on Mt 27:45-46.