Specifically, Yondu dying is a callback to multiple things from the first movie.Star-Lord survived all that before because he was immortal. Once Ego was killed, he wasn't. That was an integral part of the plot.
Yes, Yondu had to die.
The first is Groot's sacrifice when he uses himself as an airbag and leaves them with Baby Groot. Parent protecting family thematically.
The second is when Peter saves Gamora and nearly freezes to death. We're shown people freezing and dying earlier in this film as well. It recontextualizes it because we're now understanding why Peter survived that.