There wasn’t much Yondu could do to fight Ego, but at the end, that wasn’t really his goal.
Once he arrived, his main goal was to protect Peter, for reasons maybe even Star-Lord didn’t understand until it was too late.
Whether it was intended in the initial capture or not, Yondu viewed Peter like a son, and as his “daddy,” he owed it to protect him to the best of his abilities.
Again, most of this is explained in the sequel, but it’s told so well that it’s hard not to cry as Yondu’s blue body went a bit bluer as he froze in the cold vacuum of space.