I've been told this was done mainly to steer the boat away from the side of the tunnels while the people in the rear used a pole to actually propel it. I'd love to know if this is true or not, there's precious few resources about the subject.
I grew up where the canal holiday industry was a big employer. Quite a lot of the staff used to work on towed barges in their young day. Legging is definitely how they got through tunnels. Barge poles are used to fend off after being moored up or to prevent collisions in narrow stretches. Once the barge was out the tunnel they'd throw a line to someone on the towpath and hitch back on to the horses.
Myself and a friend actually tried this a few years ago in a very tight tunnel in Northampton. We obviously had an engine, but wanted to try to see how feasible legging was. It is super hard. Constantly balancing yourself on the board so you don't go in the drink. The actual work your legs have to do is nearly impossible if you let the narrow boat slow down, and the slippery and slimy walls add to all of that. I was covered in dirt and grime after a few minutes.
I suspect they probably used the barge poles to help too, but legging was definitely a thing. Like most of the jobs around the canal industry of the 18th and 19th century, it was incredibly tough and dirty work. I take my hat off to the the guys who did it day in and day out for very little compensation.
Canal boats were traditionally towed by horses alongside on the tow path, but the paths don't go through tunnels so it's feasible that this was what they did to get through