One of the many thoughtful things that Pi has to say about his two passions (and later his two majors in college) is that both are out of fashion. In the modern world, people are becoming more ambivalent than ever about religion. After all, even out of those who would call themselves religious, few people rival Pi's dedication and quiet but intense love of God. Pi sees this in his family and the larger world around him. Likewise, zoos are "out of fashion" because so many people see them as bad for the animals. Pi talks quite a bit about the misconceptions people have about zoos taking animals away from their majestic, wild ways, when in reality, he says, zoos provide the animals with safety and security.
Pi ties this comparison together with the line "certain illusions about freedom plague them both." Here, he is suggesting that people dislike both zoos and religion because they seen to conflict with that very important 20th and 21st century value of freedom. To the modern world, these institutions seem old-fashioned, as they interfere with a creature's ability to make his own decisions and choices. One could imagine that the "safety and security" argument that Pi makes for zoos could apply to religion as well. Rather than taking away our freedom, religion provides believers with a sense that the world is a safe place and we are taken care of by a god, just as animals are by a zookeeper.