Why the lies? What might cause us to write not what is in our hearts, but what 'sounds better' on paper or computer screen?
I can think of three strong motivations, and no doubt there are others. I invite comments below from any who have experienced this and/or have theories.
Inability to Accept One's Flaws, One's True Self
The less we speak, write, and act - and the less we do so honestly - the less we show of our true selves and open ourselves up for self-examination and for outside scrutiny. Some may know what they are hiding and are pretty sure they don't want to have to feel the need to justify themselves. Knowing something about yourself doesn't mean you are okay with it. Keeping it a secret is an avoidance technique. There are others who may either suspect something about themselves or may be, on the surface, completely oblivious, but are aware enough that writing or speaking honestly will produce dissonance and discomfort.
Compromising with Those Who Have Undeserved Power
Taking a stand on an issue can, to some, feel or come across as selfish, snobbish, persecutory or worse. This is not necessarily true - your words, your truth would have to be conveyed in a way to do violence to another in order for that to be true. Nevertheless, some writers feel a need to compromise on what they believe is true in order to conform to politically correct standards. The fear of offending others can do serious damage to promising writing. One question I ask: why is my belief less worthy, less valuable than that of anyone else? Personally, I'd rather read an honest, but controversial, piece of writing than smarmy lies and half-truths aimed at appeasing the easily offended and undeservedly powerful.
Fear of Repercussions
Related to, but a little different from the above, is the fear of repercussions as a rationale for dishonesty in writing. Some tone down, alter or even decline to write their truth for fear of losing supporters, fans, or friends. Some writers, especially those writing controversially on the topics of religion or politics, for example, may face real threats from radicals and the insane. And of course, truth can potentially affect future work with conservative publishers or media outlets.
What is most important ultimately, is deciding why you're a writer, what your purpose is, and how you want that to manifest. Is it more important to be true to yourself or to get along with everyone? Personally, I believe if you can't say what you think, there is no point to speaking (or writing) at all.