Marvel movies have gotten quite allot of ribbing lately for the lack of consequences in them. They are often ridiculed as movies where death has no real consequences. People ignore that DC did the exact same thing with Superman.
Infinity War asks a very important question here: can you make death meaningful even when you know it is meaningless. The answer is a resounding yes. You know that these characters are coming back. Some movies are already in shooting. The McGuffin can rewrite reality. But it makes you care.
Most the sadness of the final act comes from knowing the characters. They are like real people you know. And when they feel loss, you feel loss. When Iron Man is forlorn with Parker dying in his arms, you know the characters and what it means to them.
So Marvel did something extremely difficult. They made a movie that ended with a bunch of meaningless deaths, and made them meaningful. Regardless of how Part 2 ends up, that is a big feather in their cap.