^Not cannon, but Sulu was actually serving as first-officer of the Exeter
at the time of TSFS. Recall his line in TWOK: "I'm delighted. Any chance to go aboard the Enterprise
." As he wasn't a normal part of the command crew, he probably didn't have an access code that would be recogized by the computer.
It's possible Chekov was re-assigned either to Enterprise
or directly to Kirk after Reliant
was destroyed, as he wouldn't have had a ship to go back to. Given his involvement in Khan's escape and the creation of Genesis, it may be that Starfleet wasn't willing to offer him a ship of his own, so he stayed with Kirk because he had nowhere else to go. Terrell was dead, and it's not clear what happened to the surviving Reliant
Kirk was himself only in command of the vessel temporarily, but if we're to believe that he would have taken possession of all command codes from Spock, it makes sense that he would have been able to arm the destruct sequence using the same code as before. Scotty was still assigned to Enterprise
as chief engineer, so nothing would have changed for him.
OTOH, it may also be that the computer was expecting input from the vessel's commanding officer, chief engineer, and science officer. As Spock was absent, Chekov would have been the right choice to enter his code.
I don't necessarily believe that only the top three ranking officers present would be needed. Remember, Beverly Crusher entered her code to enable Enterprise-E's
sequence, and physicians normally fall outide the normal chain of command, even if they hold a fairly high rank.