The irony of the boys sleeping in the church is that Ponyboy hasn't been to a church in a long time. He used to attend church regularly, even after his parents died. However, Ponyboy had a bad experience in church when he decided to attend with Johnny, Soda, Steve, and Two-Bit. Johnny sat with Ponyboy in the back of the church and tried to absorb the sermon. Steve grew bored, and he decided to throw paper with Two-Bit and Soda, and then Steve dropped a hymn book with a loud sound. Everyone turned around to stare at the group, and Johnny and Ponyboy were extremely embarrassed. As a result, Ponyboy and Johnny feel as though they are not welcome in church, so it's ironic that they are hiding out in a church and seeking refuge there.
Hinton creates irony in The Outsiders when Dally, the chief hood of them all, the boy with a rap sheet a mile long, suggests the church as a hiding place. Furthermore, the boys' sleeping in the church is ironic, because they are hiding from the authorities who are searching for them because of pending murder charges. The old church is traditional and represents faith and holiness. The greaser boys, Johnny and Ponyboy, are rebellious young men who killed a boy in self-defense in a gang fight. Although the contrast of the boys' situation and the sanctity of the church creates irony in the story, Hinton's use of the church as a setting also suggests that even greaser boys can find redemption.
It is partly ironic because Johnny is sort of a symbol of Jesus Christ - he signs his name 'J.C.' in the ground when he leaves and he comes back to save the children and ends up dying for them.