Well, if you think about it, Neagan killing Judith would work better for the show. In the comics, Rick is keeping Neagan in a cell. There's no way they are going to keep paying Jeffery Dean Morgan just to have him sitting in a cell. Neagan killing Judith means that Rick would be seen as justified in killing Neagan.
I know there are a lot of fans that would love to see Glenn survive past the Alexandrians encountering Neagan, but I could also see them going even further with Neagan and having him kill both Glenn AND Judith instead of a swap of one for the other.