Why did she lock him in there anyway? He obviously couldn't do anything to actually stop her, since 1) she outranked him, and 2) she could probably kick his ass if he tried anything.
Once she beamed Kirk, McCoy, and Sulu up to the Enterprise,
she had to make a break for it herself. Whether you buy into what McIntyre wrote (Uhura just barely makes it inside the Vulcan embassy gates as Starfleet security officers catch up to her) or you come up with an alternate means of her getting off-world and to Vulcan, locking Mr. Adventure in the closet means Uhura won't be missed from her sleepy little transporter station until her next check-in time. Whereas if Mr. Adventure is left to his own devices, you know
he'll call security the minute she leaves the building.