Quite often, if the actor isn’t tall enough to pull that off, it means filming in such a way as to create the illusion that he is.
As ridiculous as it sounds, actor height can be a significant image in the movies.
Zendays tells Variety that she clearly saw her height as a problem, as the movie would likely want Peter Parker to be taller than the women in the shot.
Most of the time the movie wants to show their male protagonist as being powerful and imposing, and so when it comes to visual storytelling, that means making him the tallest person in the frame.