I think the whole orphan/terrible family situation worked well for the story because Harry's life with the Dursleys is the complete opposite of his life in the wizarding world and at Hogwarts, and the point of at least the first book was that he finally found a place where he fit in and made friends and found happiness. The two situations are contrasted nicely, but I agree that Harry from an emotional standpoint isn't portrayed as realistically as he could. But given that it's a children's book, like Chaos said, that is kind of understandable too.
The books actually do show some good effects on Harry's personality that his background gave him. Because he WASN'T raised the same way Dudley was, he is the opposite of Dudley - grateful and humble instead of spoiled and entitled, selfless instead of selfish, etc. Also, I think because he never had any friends or close family growing up, he latches on to the friendships and bonds he does make in the wizarding world, and would do anything for those people. And that love he has for his friends and people he views as family is so important to the series as a whole. And while it's true that in real life, he would probably have such attachment and trust issues that he would have a lot more trouble forming those close bonds, it works for the story.
Edit: Also, at the risk of revealing too much (so... spoiler warning?), when you learn more about Voldemort's back story in the later books, especially book 6, and see the similarities between his childhood and Harry's, I think you can see why JKR chose to make Harry so unusually well-adjusted. Harry's upbringing made him a stronger, better person in the end. Because he was so neglected as a child, he's never comfortable being in the spotlight in the wizarding world and doesn't relish being "The Boy Who Lived" or "The Chosen One." Whereas Voldemort takes the realization that he is a wizard and runs with it, feeling that he IS special and is destined for more. His own abandonment issues manifest not only in his evilness, but in the fact that although he has a whole horde of faithful followers, he has no attachments himself and has no qualms about killing or sacrificing his own allies. He is the anti-Harry. So I think maybe that's also why JKR wrote Harry as a pretty normal, modest, loving person after all, because she wanted to juxtapose him with Voldy's arrogance, autonomy, and hate. They are two extremes that make both characters larger than life, but that's the fun of a fantasy story. They follow the classic archetypes of the hero and the villain so well.