I also have to wonder what the 'dead' guy's plan was after Kirk would get convicted for his death. Presumably he'd need to climb out of whatever rathole he was hiding in for breakfast, and I'd presume someone on the ship would notice that the dead guy is alive, and that the conviction should be overturned.
---
Truly, the level of and attention to security on the Enterprise-C was shameful. In "The Conscience of a King" (an excellent episode), one of the traveling actors manages to - not only steal a weapon - presumably from the armory - but also rig it to explode and plant it in the Captain's quarters.
Starfleet in that era should have seriously formed an independent, no-bullshit, no-nonsense commission to ask the relevant enlisted and commissioned officers pressing questions, like 'Did you, or did you not leave the hatch coaming on Deck C open, thus allowing an enemy agent access to the arms locker? Are you in collusion with enemy agents?'