Actually, it was necessary. Sorry to get all English Class up in here, but Gaudi's death is symbolic.
Ever since they found him in the caves, Gaudi has been Hero's 'guiding light' to Damsel. Every time they were separated, he helped lead them back together. Hero's been struggling a lot in the temple up to this point, and this episode is where he's at his weakest. His guiding light has been snuffed out, and Damsel is incapacitated. He can't afford to be weak any longer, so he's being forced out of his hangups by necessity.
I feel pretentious now.
Part 31:
Legends of the Hidden Temple