For the Watch
Jon Snow does the necessary thing ÔÇö letting the wildlings through the Wall to keep them out of the dead's army ÔÇö and his own brothers put their knives in him for it. The Watch executes its Lord Commander for the crime of understanding the war they were founded to fight.
The fuller tale
Jon Snow had been elected Lord Commander by one vote and spent his term doing the necessary and unforgivable: making peace with the free folk, opening the gate for them, settling them in the Gift, and manning castles that had stood empty for centuries with men his brothers had spent their lives fighting.
Every one of those decisions was correct and every one of them looked like treason to men who had lost fathers and brothers to wildling raids. He had also, by the end, decided to ride south against Winterfell, which was a plain breach of the vow whatever his reasons were.
They called him out into the yard with a false message about his uncle and put their knives in him one after another, each of them saying the same two words. The last was the boy who had been his steward, weeping.
An order killing itself
The Night's Watch was founded to hold the Wall against exactly one enemy, and at the moment that enemy finally arrived the order executed its own commander for taking it seriously. There is no version of that which is not an institution failing at the only thing it exists for.
It is also completely understandable from inside. These were men who had buried friends killed by the people Jon had just let through the gate, being asked to accept that everything they had suffered for was now beside the point. Being right is not the same as being able to bring people with you, and he could not.
Elsewhere in the wiki
 See the world as it stood in 301 AC What became of it  if an ending is written, it is here. Spoilers.
The chronicle records no ending here ÔÇö or none the maesters have set down.