Desna
I understand him a bit. He's been cut off from the world since the moment the end came. He knows of the dangers of walkers, but he's been oblivious to how people have changed, too. He is a quiet, timid, gentle man before the end and has maintained that instead of hardening like most of the rest of the remaining population. Rick's people are likely the first living beings he's come across face to face since the end. So you could say he's just waking up to the horrors that the world has become. He's been in a coma and now he's seeing a very changed world. He couldn't believe that people would attack and cannibalize another. I'm pretty sure he wasn't sure he could believe who was the good and who was the bad, too.
Afterall, you have two different groups arriving at your doorstep, each side says the other is bad. Termites did all the awful things they did, but all according to Rick's group. Then you watch Rick and his group brutally slaughter all of the remaining Termites right there in a church even after Gareth said he'd leave peacefully. Though, Rick knew he'd go right back to eating and tricking others like before, and probably wouldn't give up on his vendetta, as well.
Hell, if I was put right in the middle of that and you were stuck with these people I'd want to know who was telling the truth. If I had a bunch of people enter my home, murder several people, and claim they were the good ones I'd have doubts myself. He went to the school to find that out. He knew where the Termites were camped thanks to Bob informing the group. He went to see if he could learn the truth. And he learned that the world had become a much worse place than just the living walking around. It was an eye-opener he needed.
He ran back to the church since it was the only place he knew was safe. He just didn't have the time he needed to slip under the church again to get into his office again. It was a very stupid plan, but I do understand why he would do it as a character. And making mistakes is part of growing up. I just hope he learns from what he did and doesn't do it again.
As for Michonne and Carl letting him in, I'm glad they did. Had they not they would have been as bad as him for being too cowardly to open the door for people he knew and likely cared about who begged for help. It would have been too cold-hearted, even for Michonne and Carl to do to anyone.
I don't think Gabriel needs to die. I think he needs to grow up and learn.
While I do side with you when it comes to trying to figure out who the supposed "Good ones" are...
if we were in that situation where everything is a matter of life and death and you're still in the mind set of "who's the good guy and who's the bad guy" im certain that you won't last long.
in the end, its about who can provide security and better chances of surviving...
as for Gabriel needing to die? well, if he can keep up with the group and not slow them down then im sure he has a place in the group...
i kinda feel as if he would fill in the role of Hershel/Dale eventually who's going to help guide some level of moral compass for everyone but then again, the distrust that the group my have for him would definitely be there...
If i were in Rick's group, i'd question my self whether this guy would shut the door on us if we ever need help like he did before and this generally means that he's off on his own.