If walking’s the same speed as riding, but easier, why not walk?)
I did a sportif earlier in the year. Two brutes of a climb on it. I walked, and was going faster than guys who were riding it. They didn’t like being passed!!!
Reason doesn’t come into it: you’re most likely riding in a big circle. Walking may be faster than riding, but not-riding-at-all would get you to the pub even faster. If I’m there to ride, I’ll ride if I can.
It’s rare that walking is faster, and when walking you have a bike to push! That said, it does use the muscles rather differently, and while off road (especially touring) walking isn’t unknown. But riding! Better if I can!