This comes in 2 forms. Ellies implied consent and Joels guilt.
In the lead up to the hospital there are some exchanges between Ellie and Joel that imply that Ellie is fine with what the fireflies want to do. When Joel voices that hes having second thoughts and they should turn around and go back to Jackson. Ellie says she doesn't want everything they went through to be for nothing, which is a fair notion. But, at this point neither of them know the true nature of what the fireflies want to do. Joel has no reason to get cold feet and Ellie acts as if she is prepared to make the ultimate sacrifice. For all they knew she could just be getting blood tests, so why the intensity? This is particularly jarring because all their interactions up to that moment had been looking at the future and what they would do after, but as soon as the hospital is in view that tone shifts. Almost as if the writers remembered there was a morally ambiguous ending to set up minutes before it was due.
Left Behind flashbacks are used to reinforce that Ellies consent through her having survivors guilt when Riley died and she didn't.
In their last chat before credits roll, Ellie's tone is one of disappointment. Another chance to reinforce that she would have been fine with what the fireflies were going to do and Joel had robbed her life of meaning. However, she shouldn't have known that there was a sacrifice to be made so there was no reason to be so suspicious and doubt Joel who has done nothing but look out for her. On the other hand, Joel didn't have to lie.
The tape where Bruce (Jerry) says that there had been many unsuccessful tries is very hard to miss, and it clearly states that every time they had tried to replicate it in the lab they had failed. Ellie was just another test, statistically guaranteed to fail. Even ignoring the fireflies were a terrorist militia and that Joel had every right not to trust them. That tape alone absolved him. He should have told Ellie their intentions and shown her the tape. Given everything that happens and what he learns, there was no reason to tell a blatant lie. Which, again, was just another way for the writters to make Joels actions seem wrong because he felt guilty.
Joel literally did nothing wrong.
TLDR: Writers force consent and guilt through misplaced exposition so they can make Joel a morally ambiguous character to justify his death in TLOU2