This isn't a ship full of game of thrones characters, so for the sake of his own sanity and reputation, he did the right thing. Janeway was acting as Seven's protector/mentor, and the moment she got wind of it, she would have came down hard on him.
Technically, they're both adults and it's none of her business, but that's not going to make one bit of difference with Janeway. She was not going to see it that way.
So here's the following sequence of events;
- If Harry and Seven did it, Harry's going to worry that Seven is going to blurt it out to everyone
- So Harry might tell her "hey, this is private, not everyone has to know, OK?"
- It makes sense, but he'll probably feel like a creepy molester for telling her that though
- Seven, not knowing any better, would probably blurt it out at the slightest on the bridge, in front of everyone; "I have to go now, I have an appointment to go copulate with ensign Harry Kim"
- Once Janeway finds out, she'll chew the hell out of Harry and then guilt trip him for the rest of show.
- And then Harry will never get his promotion.
So Harry has to weigh an instant, wild, no strings attached sexual experience with a consenting Seven against his reputation as a gentleman being in question.
Then again who cares ?