Probably a duplicate but searching turns up nothing.
See the following video: https://youtu.be/5ghPlBoLE0U?t=7m25s
Since the player did them no harm the fact that they attack the player makes no sense whatsoever.
Linked issues
duplicates 1
Comments 4
So it's completely intentionally designed so that zombie pigmen are meant to attack completely irrelevant targets? Can you provide a Mojang source for this?
This is intended, and is a result of the zombified piglins' Anger tag.