If you are in politics or show business you might want to liked as MEANS. Otherwise you might prefer to be liked as an END. It's probably best to not be hated as a general rule except by very bad people. Then it's a badge of honor.
I believe that it is definitely better to be who you are. If people don't like you, then rather than pretending to be somebody that you are not in order to impress people, you should work on becoming a better person. Take criticism on board. If there is a specific problem that people seem to have with you, try and see about resolving the issue with their help. It's not about completely changing your person, though.
Of course, the most important thing is being happy with who you are, regardless of what other people think. If you manage that, then you're pretty much sorted. It's better to have a few people who like you for who you are than having lots of people like 'you' because of a facade. True friends are the sorts of people who will understand you and will point out any problems constructively and help you if you ask.
I don't really know if it should ever be a case of being 'hated for who you are'. A lot of people think things that perhaps not everybody would understand or agree with. The trick, however, is to be tactfully in what you do and say in front of other people. I'm not exactly talking about lying to make yourself look better, but rather just not saying things that you know will upset or offend other people. It's very much a case of respecting those around you.
If I may add to my previous answer in this thread.
Overall it's way better to be liked for who you are not, than being hated for who you are, many more doors will stand open.
If you are hated, too much hate and misunderstandings may spiral out of control.