You are a Starfleet Captain... a captain with needs... you create a program on the holodeck where Worf is tea-bagging commander Riker - moral or not?
If nobody else sees it - what's the problem? How is it really different from simply thinking about the same activities?
Well, I think it would make you a bit of a creep, even if it only involved holograms of another person without their consent.
In a way, it's not much different than fantasizing about a person, but I think there are important differences. You can't police people's thoughts, but you can make laws about interactive software which could be misrepresenting you to a lot of people. It would also mean someone like Quark would be profiting from unauthorized use of your image.
Well we only saw those 3d holo cameras that capture the details below the clothes twice. Quark had one and the Doctor on Voyager had one. But that perv(played by Jeffery Combs!) wanted an accurate holo of Kira, so Quark resorted to his antics. Though why he just didn't have one of his waiters take a picture of Kira while he was talking to her is beyond me. But yeah, obtaining a holo like that should be illegal.
Yeah, that's the episode that came to my mind reading this. I don't know about laws then, but I know that now, in real life, people have certain rights to the way their likeness is being used. And I think many would object to it being used for something like simulated sex in a holo program. Again, no idea how such things would work in the ST universe, but in real life, we have things like model release forms to authorize the use of (and profit from) someone's likeness.
I know I keep talking about legal matters and not moral ones...