It's a bit brutal, and not a great look, but when a community is that small, I'd argue that you really don't have many choices.
-Exiling him is easiest, but he's 100% the type that would lurk around waiting for a chance to hurt you if he didn't immediately get bitten. You'd be asleep when he leads some new randoms there, or he's got a trap set up when you're out on a run, etc. Bad idea to let chaotic elements roam free.
-There's the forgiveness/pardon/second chance route, but they've already done that (repeatedly) with him and it's not panning out.
-they don't really have the resources for keeping him prisoner, despite what they are doing with Neegan. Community is small enough that everyone has to pull their weight, can't have a person consuming resources that's bringing nothing to the table. And gives him chances to become a martyr, rallying cry, or just talk to people and ferment dissent.
-Or you just take the ethics hit and kill him, preferably quickly/painlessly as possible, and in the open as opposed to trying to hide it. It's at least an example that you tried, but the rules are important and can't have people working against the community (repeatedly). Not going to make you many friends, but gotta at least hope the community sees it as Him against Us, and not as a leader overstepping or being malicious.
My question is what happened to the guy that tried to kill Maggie? His hands were tied up at the end, but they didn't take it beyond that. I'd have assumed she'd have had to hang him too, to put an end to it, and can't really kill the guy that talked about murder but pardon the attempted murderer (although first offense, caught up in grief, maybe you try the short leash?). If you were going to hang him, you'd have done it as a double, not one at a time. gives you too long to deal with reactions or second thoughts, lets the crowd turn on you. Hang them together or just Gregory. So I guess he's getting probation?