The books haven't gotten that far yet. This is likely to come in the upcoming novel "The Winds of Winter" (which has the same title as the final episode). So I can't help give you an answer from the books.
From the show's point of view however, having Lancel follow one of the "Little Birds" into the tunnels under the Sept gave us an idea of how the explosion was set up and how it would take place. It is likely Lancel would've died either way, however by having him be led into the Sept's cellar not only gives the viewers an idea of the scale of the operation, but also keeps alive the possibility that Lancel can save the Sept and everyone inside.
This answer is very opinionated, since it is the final episode in the TV series, and has not yet been mentioned in the novels.
I was however able to find an interview with the actor where he discusses the scene a little bit:
What was it like crawling through the corridor?
The thing about the whole scene was that for the last two years, we’ve seen Lancel be this stoic, disciplined, focused individual, with a rather limited demonstration of much emotion. But when the worst happens to him, and he finds himself staring death in the face, he tries to do his utmost to solve it. He doesn’t give up. He doesn’t cry. But he is, for the first time we’ve seen in a while, really brave. He wants to make sure everything he’s worked for doesn’t go up in flames. And having just suddenly been paralyzed, and being on his own, with no one around him, he would probably bleed to death anyway if he didn’t get the candles out in time. And yet, he still does his best. I found that to be rather emotional, because for all of his bad choices, all the bad things that have happened to him, he still tries his very hardest to do what he believes to be right. And that made him vulnerable again. I could have played that entire reaction very robotically, the way he’s been. But instead, I let him cry out in pain and didn’t deprive him of his humanity. He was still human. He was scared. He didn’t want to die. But I am glad that my character has died the way he has. It was quite a cathartic experience for me.
Vulture.com: Interview with Eugene Simon