Kirk is not really mad at them. On the contrary he is thrilled that two of his crewmen and friends have found love and happiness on his ship. But the sad fact is that when they get caught in the act in a place where they really shouldn't have been by someone out-ranking them both, Kirk has no other choice but to discipline them.
Scotty is ashamed. He is ashamed of being talked into it by his partner even though they were both on the clock still and in risk of being caught. But who is he to resist his dear doctor when he cocks his eyebrow suggestively while tracing his fingertips over the front of Scotty's pants? So it really is his own fault for giving into his desires that he now has to sit here, stared down by the captain and other required personnel. However it does not stop him from blaming his lover any less.
McCoy thinks of this whole talk as a waste of time. They are grown men and should very well be able to do as they damn pleased in their private lives. If he wants to surprise his lover on a slow day then he should be able to do so. McCoy is sure they are not the only people on board to have done it, they were just unfortunate enough to be subjected to someone's whining about it. So McCoy argues that the witness in question could have seen anyone as her statements are shaky at best, and he demands to know how could Kirk instantly blame them of all people.
He regrets this burst of defensiveness as Spock raises an eyebrow at him and plays them the footage that has been logged into the security system. He lets it play for a solid minute before asking if the doctor needed more time to rethink his statement or could he verify that it is him and Mr. Scott on screen. McCoy could swear that the green-blooded bastard is enjoying this humiliation so he doesn't dignify the question with an answer.