There seems to be a strict code about Captains and their Yeomans not fraternizing. From The Naked Time:
KIRK: I have a beautiful yeoman. Have you noticed her, Mister Spock? You're allowed to notice her. The Captain's not permitted...
SPOCK: Jim, there is an intermix formula.
KIRK: Now I know why it's called she.
SPOCK: It's never been tested. It's a theoretical relationship between time and antimatter.
KIRK: Flesh woman to touch, to hold. A beach to walk on. A few days, no braid on my shoulder.
Then later under his breath, while glancing at Rand:
KIRK: (gazing at Janice) No beach to walk on.
RAND: Sir?
Was it the rules or Kirk's devotion to his ship and duty. In "Miri", Rand comments that she had tried to get Kirk to notice her...
There's also pretty much always a hard fast rule in play between men and women when inhibitions are removed. Their titles don't matter.
I'd also add the part in Balance of Terror where Jim is hugging Rand right before the Romulan plasma torpedo hits. He's not hugging anyone else, and I doubt it's for stability. But possibly not expecting to survive for much longer, I think the reasons of propriety might have slipped.
While some may find it corny I liked when Kirk hugged Rand. It showed that Kirk was only human and that he really didn't expect to survive.