Short answer:
Because of many different factions among the orcs, they were held together by brutal commanders.
These commanders made sure the "cannon fodder" did not interfere with the more loyal evil men.
The men allied with Sauron had their own will, and while having only disgust for orcs, were a lot more disciplined and obeying.
Having the same goal and same supreme chief helps a lot in ignoring your "allied-but-hated" neighboor.
Truth is, orcs and men were not really "side by side", but rather batallions next to another, until the battle begun.
Long answer:
Sauron's army
It is true, orcs have a long history of internal fightings. They squabble over petty things, as can be remembered in Cirith Ungol's tower (two factions fighting over the mithril chainmail) or when the Uruk-hai Uglùk is "putting some sense" into those "little swine" of Red Eye orcs, as to which direction go with Merry and Pippin prisonners.
In time of no immediate threat, the orcs mostly stick together with brutal command and show of force.
We can read Tolkien's thoughts from Frodo's view, just after they narrowly escape a hunting party, mainly because the two orcs taunt each other and "the tracker" finally kills the other orc:
'Well, I call that neat as neat,' [Sam] said. 'If this nice friendliness would spread about in Mordor, half our trouble would be over.'
'Quietly, Sam,' Frodo whispered. 'There may be others about. We have evidently had a very narrow escape, and the hunt was hotter on our tracks than we guessed. But that is the spirit of Mordor, Sam; and it has spread to every corner of it. Orcs have always behaved like that, or so all tales say, when they are on their own. But you can't get much hope out of it. They hate us far more, altogether and all the time. If those two had seen us, they would have dropped all their quarrel until we were dead.'
Return of the King, Book Six, The land of the Shadow (ch. 2)
In time of war, they are still directed by commanders, although their hate for "human rebels" and "humankind" in general is more than strong enough:
[...] new strength came now streaming to the field out of Osgiliath. There they had been mustered for the sack of the City and the rape of Gondor, waiting on the call of their Captain[, the Nazgûl King]. He now was destroyed; but Gothmog the lieutenant of Morgul had flung them into the fray.
Return of the King, Book Six, The battle of the Pelennor fields (ch. 6)
Interestingly enough, in LotR, the term "rebel" is almost exclusively applied to orcs' behaviour, or when describing Sauron's minions view for their ennemies:
(Uglùk) 'No, we must stick together. These lands are dangerous: full of foul rebels and brigands.'
The two towers, Book Three, The Uruk-hai (ch. 3)
'[...] small wonder there’s bad news from the battles.'
'Who says there’s bad news?' shouted the [orc] soldier.
'Ar! Who says there isn’t?'
'That’s cursed rebel-talk, and I’ll stick you, if you don’t shut it down, see?'
Return of the King, Book Six, The land of the Shadow (ch. 2)
So on the orc side, they "suffer" the presence of humans through harsh command and as long as they also are on their side.
As for the human side, I've found so far little to no evidence of the evil's men point of view on the orcs.
Seeing however the visceral contempt and disgust for orcs that the good humans have, it's a very safe bet to assume Haradrim, or any Easterlings or Southrons in general, would feel close to or the same for the orcs.
Saruman's army
The Uruk-hai seem to be the main bulk or Saruman's army: he had a few loyal humans, some coming from the Rohirrim, but not enough to make an army.
He mostly deceived and recruited mountain men, ancient and bitter ennemies of the Rohirrim:
'Yet there are many that cry in the Dunland tongue,' said Gamling.
'I know that tongue. It is an ancient speech of men, and once was spoken in many western valleys of the Mark. Hark! They hate us, and they are glad; for our doom seems certain to them. “The king, the king!” they cry. “We will take their king. Death to the Forgoil! Death to the Strawheads! Death to the robbers of the North!” Such names they have for us. Not in half a thousand years have they forgotten their grievance that the lords of Gondor gave the Mark to Eorl the Young and made alliance with him. That old hatred Saruman has inflamed. They are fierce folk when roused.'
The two towers, Book Three, Helm's Deep (ch. 7)
So how did both of them go together?
Mostly because they shared a common goal: destroy the Rohirrim. After that, Saruman being reckless, it can be assumed he didn't really intended on giving anything to the "Dunland people":
A great many of the hillmen had given themselves up; and they were afraid, and cried for mercy.
[...] 'Help now to repair the evil in which you have joined,' said Erkenbrand. '[...] Many of you have got death as the reward of your trust in him; but had you conquered, little better would your wages have been.'
[...] The men of Dunland were amazed; for Saruman had told them that the men of Rohan were cruel and burned their captives alive.
The two towers, Book Four, The road to Isengard (ch. 8)
About human flesh
There's only one mention of human flesh eating, and it's done by Uglúk praising his master Saruman for this. However it is the only non-violent (or more precisely "not deadly") close encounter that the heroes experience. From all the other verbal encouters with orcs that are not Uruk-hai, they seem to be "only" sadistic and cruel killers.
For all we know, orcs are omnivorous, with certainly a fondness for meat, as Merry and Pippin were tossed dry bread and meat when being prisoner. Uruk-hai being a special breed of orcs, they could have received some "experimental" trainings by Saruman.
It is worth noting that cannibalism (orc meat) is either considered the lowest grade of meat when short of anything, or a sin, as we see Grishnákh, Sauron's minion, answer Uglúk's insult:
'Swine is it? How do you folk like being called swine by the muck-rakers of a dirty little wizard? It’s orc-flesh they eat, I’ll warrant.'
The two towers, Book Three, The Uruk-hai (ch. 3)