It's set in the years before the launch of the third crusade, culminating in the fall of Jerusalem to Saladin in 1187. The narrative contains plenty of historical errors, the most blatant being the antagonism between Sibylla and Guy, which is as backwards as it gets--she not only snubbed and scandalized all of the kingdom of Jerusalem, of which she was princess and then queen, with her incorrigible devotion to Guy, she even threw the Byzantine emperor Manuel for a loop by dropping her betrothal to his guy in favor of the Guy (pronounced "Gee", as in McGee, incidentally). Until the siege of Jerusalem near the end, the movie's primary protagonist, Balian, shares little more than a name with his eponym.
But so what? Having seen Commodus and one of the Gracchi brothers scheming against one another in Gladiator, you have no one to blame but yourself for expecting historical integrity from Ridley Scott. And there were some neat nods to what actually did happen--after Jerusalem is surrendered, Guy and Balian spar. Guy, who is portrayed about as one-dimensionally villainous as he can possibly be portrayed throughout the two-and-a-half hour film, is brought to his knees. Balian spares him, telling him to rise again, but this time to do so as a knight (chivalrous, honorable, etc). Well, ignoring the fact that he wasn't released by Saladin when Jerusalem fell, his next move was to initiate the siege of Acre, a desperate gamble that would eventually culminate in a highly improbable victory for what was left of the crusader states. Neat.
King of Heaven (KoH) contains plenty of the Brothers Karamazov-type lamentations over the putative existence of a God who would allow, and even sanction, such horror and brutality. It's stuff that enlightened western audiences love to eat up, and all of it is uttered by Latins with the exception of one ambivalent line from Saladin about Jerusalem being both nothing and everything. Some measure of balance, however, is provided in the depiction of "the Leper King", Baldwin IV (the only especially remarkable and memorable personality in the movie), a kingdom of the heart-and-mind kind of man who competently and judiciously holds power without being corrupted by it.
Kingdom of Heaven (KoH) was released in 2005, a year when anything encouraging a lessening of tensions between the nominally-Christian West and the Muslim world was understandably welcome. Christians--Latins and Byzantines both--and Muslims were more-or-less evenly matched in the 12th century. By the 21st, of course, there is no longer any contest (at least not militarily). Consequently, the Latins (for the sake of simplicity and presumably also for contemporary relevance, the movie is devoid of both Jews and Byzantines) take the fall over and over again for being zealous, bloodthirsty, hypocritical, and cynical. The cross is the vehicle used to deliver the moral of the story, that fighting over land in the name of religion is bad bad bad.
In an era when an absurdly fantastical movie like 300 elicits charges of anti-Islamic sentiments, it's expecting far too much for a big name like Scott to portray the crusader states in a neutral light, let alone a positive one.
That said, the movie deserves credit for not getting into the proto-colonialism nonsense. Crusading was extremely expensive. The first crusade was primarily funded privately, largely by those leading it. Godfrey of Bouillon, who would become the first ruler of the KoJ, sold the entire county of Verdun to the king of France and still had to mortgage Boullion itself to finance his expedition. It cost the typical crusader four to five years worth of income to set forth to the holy land. The poor, who comprised much of Peter the Hermit's following, were a constant drain on crusading efforts and were vociferously discouraged from taking part by the papacy itself. Subsequent crusades were financed in large part through taxation, first on the clergy and then on the general public.
Further, there had never been any prospect of the KoJ becoming a source of revenue for Europe. Over the course of its nearly two-hundred year existence, the kingdom was perpetually propped up by men, supplies, and massive financial transfers from Europe. If anything, Europe acted as a "colony" of the KoJ. The Templars, who rivaled the major Italian banking houses in their breadth, made money in Europe to spend sustaining their fortified castles, knights, sergeants, and squires in the holy land. In fact, likely the first ever income tax in the West was levied on those in England and France to finance the third crusade--now that's a genuinely ugly legacy of the crusading period! Returning from King Louis IX's second (and fatal) crusade, King Edward I of England would be the last person to lead a significant crusading effort from Europe. Twenty years later, with large scale support from the continent having dried up, the KoJ was, quite literally, driven into the sea by Muslim forces--the kingdom's last remnant was the Templar's island fortress at Arwad, a couple of miles off the Syrian coast.
Kudos, too, for (sort of) voicing the "we were here first" Christian polemic that played so well back in Europe. And play well it should have, since Christianity claimed Jerusalem as its holiest city several hundred of years before Muhammad was born and Islam claimed it as its third most holy. Booms Balian, "the Muslim holy places lie over your's[, Christians]".
Fortunately, the most historically egregious scene didn't make it past the director's cut:
When the first "knights of Christ" ("crusader" being a term invented long after the events they now refer to had come and gone) pushed through to Jerusalem, the city was defended by the Fatimids, a Shia dynasty centered in Egypt. The same Fatimids that Saladin--a Kurdish Sunni--would help conquer in the name of the Zengids, a Sunni dynasty based in Syria. Saladin would do so years before his military conflicts with the Latins (or, as the Arabs referred to them, the Franje). In other words, Saladin's army was full of men who'd spilled plenty of Fatimid blood of their own. It's doubtful many of them had a soft spot in their hearts for the great grandparents of their sacrilegious, recently vanquished rivals.
As far as the Muslims never forgetting goes, the first Arab history of the crusades wasn't written until the turn of the 20th century, so the Hospitaller wasn't as prescient as he thought he was--the Muslim world experienced 600 years of collective amnesia. That the KoJ is a minor detail in the histories of the Islamic world isn't surprising. The Latins never threatened Mecca or Medina and, save for the geographically limited conquests of the first crusade, were on the defensive for most of the kingdom's two centuries of precarious existence. The Franje were only one relatively minor group among many fighting for a stake in what has since come to be referred to as the Middle East. The 11th and 12th centuries are largely the story of expanding Turkish power in the Arab world and the competition between Damascus, Cairo, and Baghdad to become and remain the cultural center of the Islamic world. Jerusalem wasn't that important, and the other coastal cities even less so, especially since control of the seas was dominated by Byzantium throughout the crusading period.
Most people of European descent have heard of the Goths and the Mongols. They sacked Rome and Kiev, after all. The Marcomanni, though? Oh yeah, they caused a bit of trouble for the meditations guy when they crossed the Danube, right? Is that going to be on the test?
When Balian and Saladin meet just outside of Jerusalem to negotiate terms for the city's surrender, Balian is surprised by Saladin's offer to let the city's inhabitants take their things and leave without harm (in actuality, the historical Saladin allowed some of the inhabitants to be ransomed and the others sold into slavery; he didn't simply set them free).
Yes, that he is Saladin is why he, Saladin, did what he did. Tautology aside, he was financially strapped and was having expected difficulties holding together disparate groups of soldiers who had all been roped together under the budding Ayyubid dynasty. The siege of Jerusalem ninety years prior had been a much bloodier affair. In the context of the times, however, Balian would've expected the lives of the inhabitants to be spared since he was surrendering the city. His threat to Saladin was that if he didn't, a lot of Muslims would die.
It's highly probable that the Jewish and Muslim inhabitants of Jerusalem would've been spared in 1099 if the city had surrendered. It didn't, of course, and the ensuing siege caused massive crusader casualties that Jerusalem's capitulation would've avoided. Additionally, the first crusaders faced the prospect of being trapped and annihilated by a Fatimid army on the way from Egypt. Jerusalem's refusal to open its gates to them meant they had little choice but to break in or be left to slaughtered.
The primary reason the crusades have become a rallying call across the contemporary Muslim world is because of the geographical overlap between the KoJ's ancient borders and those of modern day Israel. Maybe when Texas secedes from the US and then, instead of reinstating the Lone Star Republic, petitions to become Mexico's northernmost state, whites in San Antonio will start vociferously reminding the world of the Alamo.