I think that nearly everyone has an image of the person they want to be. It's the ideal self that we compare ourselves with and that we use to judge ourselves against. And we all have moments where our actions deviate from what our ideal self would do. Some people have more of those than others. It's those moments that cause a lot of discomfort, because we have performed actions that we ourselves consider "wrong". Even if everyone else disagrees, you feel like you made a mistake.
This goes the other way as well. People may judge you for something you've done, but if your actions are aligned with your ideal self, you will not feel guilty. Some people may even commit serious crimes because they just disagree with the law. This is an important facto to consider during prosecution and the reason our justice system tends to favor those who regret what they have done. Rehabilitation is nothing but an attempt to align peoples ideal selves with what society deems acceptable.
But it's not just those extreme cases where people align their ideal selves with the ones around them. Society has a wide array of techniques to achieve this alignment, some more subtle than others. Still, we all have some aspects of our ideal selves that are not debatable. Things that are so fundamental that if we were to change them, we just would not be ourselves anymore. Society has two options for dealing with this: tolerance or suppression. In other words: they can allow their members to be the way they are or they can kick them out (whatever that means in the given context).
In turn, what can you do as an individual if you realize that your identity is incompatible with the society you live in? You have multiple options, the most obvious one being to leave (again, whatever that means in the given context). Another more tedious option is to try to change society. Almost no society is completely set in stone, so it is possible to drive change, as long as that change is not conflicting with a majority of its members. Apparently, this is not always possible or feasible. A third option is to hide. You can live your life within societal constraints, keeping your true identity as a secret. Unfortunately, this also means that you will necessarily run into those situations where your actions are in conflict with your ideal self. You will have to live with the discomfort that causes.
The interesting question now is: what should society do with those that are hiding? If they operate within the limits society imposes on them, not breaking the rules, should they be judged for what they want to be doing? Should they be prosecuted for their unfulfilled desires? Isn't it bad enough that society forces them to live in this constant state of dissonance with their ideal selves? Why does society need to force them to hide as well? Why is it human nature to not accept those that are different, even if they agree to follow all the rules? Why is it nearly impossible to trust them?
You might say that we need to know that their ideal selves are aligned with society to trust them to stay within societies boundaries when nobody is watching. But to that I say that you just cannot know what their ideal selves are and I'm pretty sure that everyone is hiding something. I think we could do a far better job at building a society that people feel comfortable in if we knew what people's true selves are, even if they are unacceptable. We might find out that these unacceptable traits are far more common and societal change might not be as far fetched as each individual has thought. We might show compassion for those we force into societal boundaries and help them cope with it. All this could be possible if we could just talk openly about our personality.
Sadly, people are too eager to jump at any opportunity to belittle others for their weaknesses to make themselves look stronger. Humans are not built for collaboration, our evolutionary past still urges us to compete. And when you're in competition, trust is a rare commodity. In my view, this is humanity's greatest weakness. Although it will certainly not happen in my lifetime, I hope that it will be overcome at some point.