The quote you are refering to comes in Chapter Fifteen, when Holden meets the nuns and has a pleasant conversation with them. In a revealing flashback, he recalls having a great conversation with another boy called Louis Shaney who was at the same school as he was. they were having a really interesting conversation about tennis, and then he asks Holden if he knew where the Catholic church was, obviously trying to work out if Holden was a Catholic. Holden concludes that he would have enjoyed his conversation with Holden more if Holden was a Catholic. Note what Holden says about this:
That kind of stuff drives me crazy. I'm not saying it ruined our conversation or anything--it didn't--but it sure as hell didn't do it any good. that's why I was glad those two nuns didn't ask me if I was a Catholic. It wouldn't have spiled the conversation if they had, but it wouldn've been different, probably.
Holden thus shows how religion, and in this case, Catholicism, creates barriers. Let us remember that Holden is on a mission to try and form personal relations that are not "phony." Therefore we can understand his resentment towards anything that prevents such connections being established.