Dally helped the boys hide at the church and genuinely cared about Johnny's future. Whe driving back from the church, Dally seems angry, and Johnny and Ponyboy think it's because he is annoyed they didn't turn themselves in earlier, if at all, to save him trouble. But he explains "in a pleading, high voice" that he just doesn't want Johnny to get hardened in jail. Ponyboy realizes how tenderly Dally feels for Johnny, and thinks about what Dally might have been like before he was toughened on the streets and in jail.
Dally hit Ponyboy to keep him from being hurt. He went into the church instead.