Piastri was not gifted a win. He was leading easily for first two stints. He lost the lead due to the team deciding to be extra conservative and protect Lando against 5 second Hamilton undercut.
It is very unfair to call his win a gifted win. In a situation where the leading driver gets preference (over the team), I am 100% sure that Piastri would not let Lando undercut him. Problem with doing it that way is that if someone is close to second driver it can lead to that driver losing their position to the other team due to strategy. Do we want to team to be able to maximize results or that drivers worry about undercut from their own teammate?
McLaren made this a problem unnecessarily but it is good to see that the drivers are smart and fair enough to be able to put the interests of the team (protect driver under threat) before their own needs.