The pilgrimage acts as a framing device, the reason why the various characters in The Canterbury Tales tell their story. Each story told is a story-within-a-story of the trip to a shrine.
The premise is that these people, who don't all know each other ahead of time, have been thrown together because they are all walking as a group to Canterbury. To pass the time on the journey without getting bored, they decide they each must tell a story to the others. This particular cohort rises admirably to the occasion, for each member of the party comes up with a lively story that reveals something about himself or herself as well as about the status of and rivalries between different groups of people in the medieval world, such as men and women or friars and parsons. While people typically embark on pilgrimages to seek religious renewal, this group comes across as worldly and pragmatic in outlook, even if many of them are members of religious orders.
Journeys are an important part of many literary works. The journey is a plot device that makes it possible for Chaucer to have all his characters together long enough to tell their stories. It gives the characters a goal, something important to achieve, over the course of the literary work. The fact that the characters want, or need, to accomplish the goal (the journey's end) tells us something important about them. If they were just sitting around the house instead of traveling, we would not perceive them in the same way.
In Chaucer's Canterbury Tales, the pilgrims' goal is the shrine of the holy martyr Thomas Becket. That lends an air of religious feeling to the entire journey. If the characters are on a spiritually important journey, then they must be pious, honest, God-loving people, right?
But we may be surprised to find out that many of them are not. As their tales unwind on the journey, we see all of the same weaknesses and faults in the characters that we would see anywhere else. This allows Chaucer to indirectly comment on the nature of religion in human society. People may play the part of pilgrims, but that doesn't mean that they really live spiritually upstanding lives. It makes it possible for Chaucer to look at the theme of hypocrisy throughout the work.