Marcus Aurelius, Meditations, George Hays translation:
Never regard something as doing you good if it makes you betray a trust, or lose your sense of shame, or makes you show hatred, suspicion, ill will, or hypocrisy, or a desire for things best done behind closed doors.
The specific part I think is interesting is this:
Never regard something as doing you good if it makes ... you show ... a desire for things best done behind closed doors.
Why is wanting to do something behind closed doors a bad sign? Marcus doesn't tell us what activities he has in mind, so we have to guess. Often, people feel the need to do things behind closed doors because they regard them as shameful in some way. Some examples that come to my mind are the use of certain substances and certain things related to sex that people are particularly ashamed of, like various fetishes. Often, people have a judgment themselves that something might be bad, which is part of why they feel shame. If part of you thinks something is bad or might be bad, you will feel like you need to hide it. This does not make it sound like a great candidate for an activity to spend your scarce time/life on!
There are criticisms one could point out about this idea. For example, one could say that people often treat entire categories of things as private without necessarily thinking they're bad. Sex in general is one example; people think that that is a private activity, without necessarily thinking it shameful. Going to the bathroom is another example. I think these are valid points. And I don't think Marcus has this sort of thing in mind – he wouldn't say that you shouldn't regard e.g. food as doing you good because you'll have to go to the bathroom after eating and that's best done behind closed doors. Based on the other things he mentions, he's specifically talking about things that elicit some negative state (loss of shame, hatred, hypocrisy) in yourself. So the way I read this, he likely thinks that you shouldn't regard something as good if it makes you want to do stuff in private that you think is bad in some way.
On this reading, what Marcus is basically saying is that you shouldn't violate your integrity. According to Ayn Rand ("The Ethics of Emergencies" in The Virtue of Selfishness):
Integrity is loyalty to one’s convictions and values; it is the policy of acting in accordance with one’s values, of expressing, upholding and translating them into practical reality.
Wanting to do something behind closed doors because you think it is bad reflects a failure to live in accordance with your values. You're acting as if by hiding the failure behind doors, you can somehow negate the failure. But you'll still know the truth in your own mind, and you'll still have failed to live in accordance with your values.