And that should've been deleted. If that's all that's missing, if there's no reveal, if there's nothing being done here with Khan that isn't done with every other scene, then it makes no sense and is wasted. I wish the Eve scene had been deleted for similar concerns.
Well, we don't know the context for the scene. Maybe it conveys that he's under stress because he's concerned about his people and humanizes him a bit more. Maybe it shows that he's tired and not as invincible as he seems at first glance. Just because it seems pointless without seeing precisely where it fits in the narrative doesn't mean it actually is.
Likewise, apart from obviously being there for titillation too, the Carol Marcus underwear scene did serve a purpose. Throughout the preceding parts of the film, we see Kirk being confident to the point of arrogance and extremely flirty with women. He was having a meaningless one night stand with the cat babes, he gave F-Me glances to the women at Starfleet HQ and the bar, and he was making juvenile comments about Carol's appearance when she boarded the shuttle to join the crew on Enterprise. But now he tries the same schtick by glancing at Carol while she changes, and she'll have none of it. She's not intimidated or impressed by his glances, and gives him nothing in return except the sign to quit gawking and an order to turn around.
Kirk is flustered by this and doesn't quite know how to react, except to do what she tells him. This plays into his continuing decline in confidence throughout the film as he is rejected or slapped down by his superiors and peers. He's not able to get by on winging it or impressing people with his overconfidence any more. He has to work to get what he wants and to earn respect.
It also establishes Carol as a strong presence who is not embarrassed about who she is, won't fall for any cheap flirty tricks, and doesn't put up with anyone's BS. This makes Kirk admire her even more and foreshadows their eventual love for each other. Carol is not like the other women Kirk has been attracted to. She's not a cheap date or a one night stand. She's an intelligent, strong, talented individual whom he respects for those qualities, and not just for her looks for a change, though that appeals to him as well.
Kirk hasn't met a woman this formidable and intriguing to him since Uhura rejected him completely in the bar in the first film. Gaela (the Orion) he used to further his own ends in the Korbayashi Maru test and then uncaringly disposed of without a second thought, but Uhura he kept pursuing for three years until he came to understand that she loved Spock, and Spock was someone he came to admire as well.
Oddly enough, the underwear scene is sort of a shorter and more blunt version of Bond and Vesper's witty banter on the train in
Casino Royale that established her to be his equal, and that didn't shy away from sexual implications either. It might seem counterintuitive to convey these kinds of ideas through a two-second underwear shot, but IMO it works in film and TV tradition of "show, don't tell."