I don't think he'd have any motive at all besides instinct.

It was easier for him to leave his church friends outside for several reasons - the doors were all locked and he couldn't even see them (so he wouldn't have had to actually witness them dying,) there were tons of them and tons of zombies, and letting even one person in may have easily resulted in everyone rushing in (including zombies.) And since he said he always locked the doors, as soon as he realized people were outside and wanting in, they were probably already angry with him, thinking he'd locked them out on purpose. I think he let the situation go unacknowledged for a tad bit too long, and by the time he could have acted, he feared everyone out there were already pissed at him. Letting a bunch of people who are pissed at you come into your sanctuary during the apocalypse would have to be pretty scary. He left them outside because the situation was overwhelming and terrifying.

If he has the chance to save one baby, of course he's going to do it. For one, he's very remorseful for what he did in the past, and I think he's grown since then. He felt awful for how that event went down, and I don't think he could live with himself if he did anything like that again. He let people down once, and he learned from that experience that even though it seems easy to only worry about yourself, after the fact it becomes a whole lot harder to even just exist, knowing your selfishness hurt other people.

So I don't think he would have any sort of "I need to save Judith for this reason" going on in his head. I think he'd just do it. Not to even anything out or impress anyone / show them how good he is. He'd just be faced with "this baby in front of you will die if you don't do something," and of course he wouldn't even consider his options. He'd save her.