Today, I heard Star Trek coming under fire for this reason more than any other. It's too nice, it's too peaceful, it's too optimistic. Human beings are flawed creatures, they can't become angels. Shows like Firefly and Battlestar Galactica have defined themselves by contrasting themselves to Star Trek on this point. Even Star Trek writers, especially on Deep Space Nine, have disputed the realism of this defining belief of Star Trek.
I have always found Star Trek's view of human beings in the future to be realistic, though certainly an optimistic projection. There are four basic reasons why I find Star Trek's vision of humanity's future realistic.
1) Human beings were much more barbaric 300 years ago than they are today. Star Trek assumes the trend will continue in that direction. We are already making "rapid progress," as Captain Picard once said.
2) The Federation has apparently renounced materialism. This seems outlandish and unimaginable to us, since materialism seems as natural to Americans and Europeans as breathing air. But materialism is not an innate human trait -- it's a relatively recent development in human history, and it's by no means universal on Earth today. One interpretation for modern materialism is that it points to a spiritual emptiness. Although the Federation isn't particularly religious, Star Trek characters seem spiritually fulfilled by their humanist belief that the purpose of existence is to improve oneself. Once people stop taking comfort in material possessions, the material needs of the whole society are much less, and the society no longer has as much cause of conflict with others.
3) Speaking of material needs, technology and space travel have eliminated most of the remaining material needs in the Federation. Food and basic goods are produced by replication. Power is produced by fusion, antimatter reactions and renewable sources. Weather disasters are preventable. Colonizing other planets has lead to unlimited land and natural resources. No one is hungry, no one is uneducated, everyone's basic needs are met.
4) For all the advantages provided by the Federation's philosophy and technology, Federation morality is not a fait accompli. Especially on Classic Trek, we see that it is a standard the characters are holding themselves to and are constantly struggling to reach. Human nature hasn't changed, just human values.
Ultimately, I think that whether you find Star Trek realistic is going to depend on a personal belief: do you believe human beings are basically good or basically evil. If you believe that people are basically evil, then you will also believe that a utopia like the Federation would free human beings to be even more diabolical. If you believe that we're basically good, then a utopia like the Federation would give us the opportunity to be angels.
To me, there is no doubt that we're basically good. If we didn't intrinsically value goodness, we couldn't even have even created the concept of goodness. Maybe my belief in human goodness is what draws me to Star Trek, or maybe it comes from the fact that I grew up watching Star Trek. I couldn't say. But that's what I believe that that's why I find Star Trek's future believable.