First of all, we have to make a distinction between the Federation, Starfleet and private persons.
The Federation protects free speech and the freedom of opinion. As such, nobody can be forced to think in a particular way, especially not civilians. Federation personnel, and especially Starfleet members might be subject to more strict policies, though.
Next, Star Trek mirrors the real world, especially the western/US world/culture. There is a cold war going on with the Romulans for most of Star Trek, with emphasis on espionage, subterfuge and deception. In TOS, there is a very open and hot war with the Klingons, and later we see the struggles of an advanced and open civilization to reconcile with their former war enemies. This is a real and believable struggle.
In the same vein, the Cardassians are war enemies and have committed atrocities against the Bajoran people. Do you really except the Federation and Starfleet to hug them and love them? What kind of signal would that send to any neighboring race that also oppresses some other race? It would send them the signal that you can do whatever the hell you want to without consequence.
So, with that in mind, lets draw some further analogies. The Federation Charter is modeled after the Universal Declaration of Human Rights (Charter of Human Rights), and there we read:
[...] recognition of the inherent dignity and of the equal and inalienable rights of all members of the human family is the foundation of freedom, justice and peace in the world [...]
[...] the peoples of the United Nations have in the Charter reaffirmed their faith in fundamental human rights, in the dignity and worth of the human person and in the equal rights of men and women and have determined to promote social progress and better standards of life in larger freedom [...]
[...] Member States have pledged themselves to achieve, in co-operation with the United Nations, the promotion of universal respect for and observance of human rights and fundamental freedoms
Especially the second part I have quoted should be strikingly familiar. Given that, why do you think racism and in-equality still exist in the real world? Why does prejudice and hate-speech still exist? This Charter is from 1948, shouldn't we have abolished all that by now?
Star Trek is not an Utopia. The goals of the Federation are noble, much like most goals of the UN: But Star Trek frequently depicts how even an advanced, and quite tolerant society struggles with basic human nature. And depicts how one has to concede to politics some times.
Lets look at your points.
Yes, this one is a bit odd. Its an official Starfleet document, and as such one would expect some moderation. Yet, that Spock is half human and half vulcan is a statement of fact. Its from the Menagerie, which has a lot of problems. At that point in Season 1 of Star Trek a lot of things were not set in stone. The writer probably thought it would be prudent to remind the audience that Spock is, in fact, not completely human.
The Federation has noble goals, but they are not stupid or naive. They are in a state of constant Cold War with the Romulans. From a security point of view, giving someone who has known ties to an enemy which is known to espionage, subterfuge and deception is just plain stupid. No matter how advanced the Federation thinks their society is, they would not count on every member of their society to share those goals unconditionally, especially if said member has ties to a different culture with a known tendency to espionage. This isn't prejudice, its just common sense.
The Cardassians have oppressed the Bajoran people. They fought the border wars against the Federation. They later joined the Dominion and again became war enemies of the Federation. Some resentment is to be expected. O'Brien fought them directly on many occasions. That he isn't really fond of them is somewhat natural. What he says are his personal views, not official Starfleet communications. If he were to write an official report, he would not describe them as "Bloody Cardies", as that would be unprofessional (and he would likely get reprimanded by his superior for it). As for offical Starfleet/Federation policy: They have to show the Cardassians - and every other race that might want to oppress another - that such behavior is intolerable. That is why you do not see the Federation hug the Cardassians. Plus, the Cardassians threaten to attack and take back DS9 multiple times.
Is already debated
This is actually a very good depiction. A society has to learn how to accept something new. They have to answer the question whether data is indeed a lifeform. Whats rights does he have? Data struggles with the law and the right of self-determination multiple times. We see this again with the Doctor later (especially e.g. in VOY: Author, Author). Is it really so hard to imagine that even the most open and tolerant society would sometime struggle to accept something radically different (A machine as lifeform? Preposterous!)? I think Data/The Doctor are one of the best aspects of Star Trek, a subtle way to challenge prejudice and preconceptions without being outright preachy. Whether the charter you quoted above, which talks about lifeform even applies to Data and the doctor is a point of discussion in TNG/VOY.
Nobody is perfect, not even the Vulcans. A race that knows-it-all and is kind and empathic (like Betazoid) would be quite boring, wouldn't it?
You call it prejudice, I call it caution. They have been at war.
Star Trek is not perfect. The Federation strives to be a better place, but struggles with the harsh reality of war, hostile neighbours, espionage, politics and deception. A society that, in light of all that, would always be loving and caring towards everyone else is simply not believable and frankly boring to tell stories in.
We see a great deal more problems where the Federation Charter clashes with reality. Ferengi are often met with prejudice, for example Quark. Yet can you really call it prejudice? Quark does everything he is accused of on a regular basis, and we see again and again how Ferengi take advantage of people who did not heed the warnings (e.g. Tom Paris rescuing Harry Kim from Quark). This isn't a black and white question, the question this imposes is where prejudice and statement of fact bleed together and where the line is drawn, and no definite answer is given. Star Trek does this a lot, challenging our own assumptions.
We even see Starfleet struggle with shady intelligence organization like Section 31, which violate even the most basic rights of Odo when they poison him.
But we always get reasons why people are pushed in a certain direction. They do not do it simply because they are racist or evil. They do it because events and experiences have led them there. And because they are flawed. And being flawed is human, but it also alien.
The Federation Charter depicts how things should be, much like the Charter of Human Rights, but Star Trek often shows how it is, with deeply flawed people that struggle under the influence of their reality of war and of their own preconceptions. But on the other hand, we also see a great deal of exploration, diplomacy, tolerance and awesomeness, lets not forget that.