Its the fact that he makes that choice which is part of what makes joel such an amazing character, throughout the game ellie and joels relationship grows to the point where they each view one another as a parent and child
He has already lost one daughter to this hellscape and he isnt letting anything take another from him
Also its worth noting that the fireflies lied about ellies immunity providing a cure, joel actually can find an audiotape which reveals that the fireflies have found immune people before and that thier immunity cannot be reverse engeniered into a vaccine
So even if he had have let the fireflies take ellie she would have died for nothing but the stubborn arrogance of a group of people who cannot accept there is no cure for this plague