In Tolkien's The Lord of the Rings series, there are generally two groups of Men. The good ones are coming from the West (Dúnedain, Men of the West), and the bad ones, the Easterlings, mostly fight under Morgoth and Sauron.
Why was this so?
Tolkien himself says The Lord of the Rings
is neither allegorical nor topical.... I cordially dislike allegory in all its manifestations, and always have done so since I grew old and wary enough to detect its presence.
From the introduction to The Lord of the Rings.
You are reading too much into The Lord of the Rings. The intent is not for it to represent the real world, especially not geographically. You are also ignoring the counter-examples of bad men from places other than the East: Black Númenóreans (from the West) and the Witch-king of Angmar (from the north).
In addition the Drúedain, represented by Ghan-buri-Ghan, are described as having "unlovely faces" and share many of the physical characteristics of Orcs and Easterlings (often used to argue the case for Tolkien's alleged racist views), yet this same race is key to the defeat of evil at the Pelennor Field and are undoubtedly good.
Basically Tolkien wrote of a world where a small pocket of the world was resisting a siege of evil, and it so happened that the pocket of the world was a peninsula on the west of a major continent.
In the man's own words, sent in a letter to his son who was stationed in South Africa during World War II and hence never intended for publishing nor for sight of other's eyes (Letter 29):
As for what you say or hint of ‘local’ conditions: I knew of them. I don't think they have much changed (even for the worse). I used to hear them discussed by my mother; and have ever since taken a special interest in that part of the world. The treatment of colour nearly always horrifies anyone going out from Britain, & not only in South Africa. Unfort[unately], not many retain that generous sentiment for long.
Tolkien was definitely anything but a racist; he was actually unusually enlightened for his time, and an even casual reading of his letters establishes this beyond any doubt:
the wholly pernicious and unscientific race-doctrine
(Letter 29)
that ruddy little ignoramus Adolf Hitler
(Letter 45)
The treatment of colour nearly always horrifies anyone going out from Britain, & not only in South Africa.
(Letter 61)
confused ideas of race or nation
(Letter 81)
I know nothing about British or American imperialism in the Far East that does not fill me with regret and disgust
(Letter 100)
Apologies if this seems to be belabouring the point, but it's very important to make it as clear as possible.
His use of East and South as domains of evil was purely a matter of geographic necessity; this is first touched on in Letter 211, discussing the Blue Wizards:
I think they went as emissaries to distant regions, East and South, far out of Númenórean range
And explicitly in Letter 229:
The placing of Mordor in the east was due to simple narrative and geographical necessity, within my 'mythology'. The original stronghold of Evil was (as traditionally) in the North; but as that had been destroyed, and was indeed under the sea, there had to be a new stronghold, far removed from the Valar, the Elves, and the sea-power of Númenor.
So the setup of the world is that the West is subject to the notice and influence of the likes of the Valar and the Númenóreans, so of course Sauron is going to set up his stronghold, and the primary sites of his influence, in the East. From there it's obvious - the Men that he's going to find easiest to corrupt will be those where his own power is strongest (and subject to the least amount of interference).
It's also interesting (and instructive) to go back and look at the tales of the First Age. Here we see that both Elves and Men originally awoke in the East, and that there were also tribes of faithful Easterlings.
Finally, there's Sam's thoughts when he sees the dead Southron (because it's not just about East and West) which reveal Tolkien's true opinion of these matters, and are worth quoting in full:
He wondered what the man's name was and where he came from; and if he was really evil of heart, or what lies or threats had led him on the long march from his home; and if he would not really rather have stayed there in peace...
So no, there's no prejudice and definitely no racism at work here.
Caveat: I haven't studied Tolkien's life - I've just read the (main) books - LoTR, The Hobbit, The Silmarillion. I've also not read academic treatments by literary critics/sociologists etc. of Tolkien's work; I'm only judging by the text.
Indeed, in my impression of Tolkien's writings, they exhibit racial and geographic/regional biases (*). Specifically, as you go West, individuals are better and nobler people on the average, more likely to be Elf or Elf-related, less likely to be Orcs; closer to the gods or to godliness - with the culmination being Valinor.
Elves who awakened did better the more they went West; they are lesser if they stayed behind, or if they returned, like the Noldor. Those who went first, who made it all the way, and didn't go back - they're the fairest, the noblest, the closest to the gods - the Vanyar.
Men's origins are unclear (well, to me anyway), but they first achieve agency, merit, morality, and historical purpose as they flee westwards and submit themselves to the Elves, both in terms of government and of culture - the Edain houses of Bëor, Haldad and Marach. The rest of humanity remains a far-off jumbled basket of deplorables - most of the time - always considered to be under the sway or control of Melkor or Mairon, directly or indirectly. On Númenor, again - men who take after the Elves and look to the West are morally superior; the baser, greedy, immoral, go Eastward, fraternizing with the rest of mankind. Big mistake - that leads to their downfall. In the Third Age - the men of import are those descendants of the three Edain clans, sticking to the North-West of Middle-earth; and the rest of humanity? What have they done over ~6,000 years? Not much of consequence apparently, other than training Elephants and perhaps some quaint jewelry. Tolkien has also not shown enough interest in these cultures to develop linguistic features or alphabets for them as he had for the Western, Elf-associated Humans - an implicit decision that they do not have anything of note to express or relate.
This also has to do with 'physical' racism. The Southrons are swarthy; the Easterlings are apparently more variegated, but at least some may be modeled after the Balochi people. At any rate, we're not talking about light-skinned, blond-haired peoples, that's for sure. And as you move up the ladder of superiority and godliness, we get to the Vanyar again - light-skinned and blond (or you can just add the value judgment and say they were "fair" of skin and hair). I'm not saying the racial picture is entirely consistent, or that there aren't exceptions to the rule (Lúthien and Arwen aren't blond), but still, this all resonates pretty strongly in my opinion.
* - and one could also consider critically the place of women in his writings, or how it contrasts hereditary feudalism with industrial capitalism etc. Lots of fun.
I would say, yes, he was.
Most of the other answers either dispute that Tolkien was prejudiced against the East, or focus on textual analysis and don't talk about his own quotes. The answers focusing on the text of The Lord of the Rings and the Silmarillion have already discussed how the West is associated with Valinor whereas the East is associated with Sauron.
However, Tolkien's own quotes are perhaps the most convincing evidence. Here's the famous one about the symbolism of Orcs:
Why does Z put beaks and feathers on Orcs!? (Orcs is not a form of Auks.) The Orcs are definitely stated to be corruptions of the 'human' form seen in Elves and Men. They are (or were) squat, broad, flat-nosed, sallow-skinned, with wide mouths and slant eyes: in fact degraded and repulsive versions of the (to Europeans) least lovely Mongol-types.
The Letters of J.R.R. Tolkien
In essence, Tolkien here equates typical characteristics of Asian people ("sallow skin" and "slant eyes") with "corruptions of the human form." This isn't far from saying that Asian people are less human than other groups. While he does show some self-awareness, claming that it's specifically Europeans who see them this way, he doesn't exclude himself from that group. In fact, one could view this as an attempt to justify his own beliefs in this regard, by suggesting it's simply the way all the Europeans think. It's hard to argue that this isn't prejudice against the East!
As further evidence:
The quarrelsome, conceited Greeks managed to pull it off against Xerxes; but the abominable chemists and engineers have put such a power into Xerxes' hands, and all ant-communities, that decent folk don't seem to have a chance. We are all trying to do the Alexander-touch – and, as history teaches, that orientalized Alexander and all his generals. The poor boob fancied (or liked people to fancy) he was the son of Dionysus, and died of drink.
The Letters of J.R.R. Tolkien
Here the influence of Xerxes is conceived of as having "orientalized" Alexander of Macedonia, having made him more Asian. This, as the surrounding text indicates, is clearly portrayed as negative. The East was indolent and indulgent—thus why Alexander turned to drink. This is the view of the East hinted at in The Lord of the Rings, frequently taught in classes on the history of Western civilization in Tolkien's time and thereafter. It's also the same view that pops up in the comic book 300: the civilized West, with its martial virtues versus the chaotic, luxurious East.
How to reconcile this with Tolkien's other quotes, mentioned in other answers, where he expressed dislike of the British Empire and of Hitler? Well, in fact, even Tolkien's own condemnation of British actions in South Africa is more nuanced than it might seem at first:
As for what you say or hint of ‘local’ conditions: I knew of them. I don't think they have much changed (even for the worse). I used to hear them discussed by my mother; and have ever since taken a special interest in that part of the world. The treatment of colour nearly always horrifies anyone going out from Britain, & not only in South Africa. Unfort. not many retain that generous sentiment for long.
The Letters of J.R.R. Tolkien
While he implies a certain opposition to British actions in South Africa, he also conveys a certain ambivalence. The horror at the harm done by British imperialism is a "generous" sentiment—a phrase which implies it to be a bit excessive and perhaps somewhat naive. It's not clear that Tolkien is suggesting that he shares that sentiment, at least not without reservations.
But more pertinently, as with everything, there are degrees. The truth is that racism and pure evil are not synonyms, and it was perfectly possible for someone to recognize the brutality of Hitler and even that of their own country, without being entirely free of racial prejudice or animosity.
As an example of this, we could also turn to Tolkien's opinions of another group, originally from the Middle East, Jews. One can't deny that he had a primarily positive opinion of Jews, as evidence by his impassioned response to a letter from an anti-Semite:
But if I am to understand that you are enquiring whether I am of Jewish origin, I can only reply that I regret that I appear to have no ancestors of that gifted people.
The Letters of J.R.R. Tolkien
However, that doesn't mean his opinions were entirely positive. To start with, he treats Judaism as something out of the ordinary:
My companion in misfortune was Cecil Roth (the learned Jew historian).
The Letters of J.R.R. Tolkien
And of course, there's the matter of him explicitly having based the dwarves on Jews, and made their defining flaw their greed.
The dwarves of course are quite obviously, wouldn't you say that in many ways they remind you of the Jews? Their words are Semitic, obviously, constructed to be Semitic.
In short, just because he wasn't hostile to Jews as a matter of principle, doesn't mean he didn't buy into negative stereotypes about them. With this in mind, it's not hard to see how he could have negative views about Asians and Africans that he expressed in his work, even while outright opposing extreme manifestations of racism like British imperialism or Nazism.
Actually most of the characters who are explicitly evil or corrupt come from or are associated with the west.
Indeed there is a recurrent theme that moral virtue is much more about character and individual decisions than background, most notably in comparison between Saruman (who is even called 'Saruman The White') and Gandalf. Similarly The father and son, Denethor and Boromir end up being corrupted by the ring and betraying their allies while Faramir remains virtuous.
The hill tribes who ally with Saruman against the Rohirrim are also from the west and Wormtongue is actually one of the Rohirrim, or at least able to pass for one.
Even Isildur, Aragorn's direct ancestor, is shown as being deeply flawed.
In fact the Harradrim and Easterlings don't really figure that much in the story apart from being allies of Sauron and even then the overall impression is that they just happen to have the misfortune to live in areas which have been conquered by him. Indeed Faramir expresses regret at having to fight them, he has a line commenting on a dead enemy soldier 'I wonder what lies and threats led him here'.
There is also the fact that, as others have mentioned, Tolkien's work was largely inspired by the northwest European literary tradition where 'the West' is largely unknown and mysterious by the simple fact of being filled with the North Atlantic Ocean so it was essentially like space as far as they were concerned.
Even at the very end of the book in The Scouring of the Shire it is made clear that even Hobbits can be corrupt and malicious.
In fact overall I would say that the overall message from the narrative is that merit does not depend on race class or status.
There is also the fact that, while a superficial reading shows all of the heroes being attractive white men the real heroes of the story are short yokels with big hairy feet and it is fundamental moral qualities which makes the heroes attractive, even Aragorn is initially introduced as a dishevelled and sinister figure while the overtly charismatic and powerful figures are all flawed.
My take on the racism issue: (not specifically the east-west problem) In universe, the Númenóreans/Dúnedain are deeply racist. Even Faramir (who is presented as wise and kind) categorizes people as: Us, Men of Twilight, Men of Darkness.
Gondor even had a civil war because one king married a non-Dúnedain woman. The fact is that Tolkien created a word where racism is kind of justified: Unlike in the real world, Númenóreans are physically stronger and much more long-lived than other races, because they are blessed by the Valar.
But it is never ever even implied that therefore they have the right to play master race: When they try to do so in the late Second Age, this is highlighted as a grave sin. They are meant to be teachers and helpers to the lesser men.
As shown in other answers, the Númenórean physical-mental-lifespan superiority does not imply moral superiority: They are just as susceptible to temptation, and indeed, their pride and knowledge of their special status gives Evil an extra leverage over them. It is clearly seen in The Lord of the Rings that Gondor is most successful when they cooperate with 'lesser men' as equals. In the Kinstrife, they harm themselves greatly by their racism, fearing that their lifespan will decline if they mingle with others. Yet they started to decline in Númenor well before intermarrying with other races, because they got estranged from the Eldar and Valar.
In conclusion, Tolkien was not above the idea that some race or nation could be given greater physical and mental capabilities than others, but firmly held (as a Catholic) that all humans are morally and ontologically created equal. He rejected (as shown from his letters in other answers) any oppression or aggression on pretext of race.
So he was somewhat racist, but in a patronizingly benevolent way, quite typical of his late Victorian upbringing, well-meaning, but very irritating to modern sensibilities.
The same theme can be seen in the case of the first age Beleriand: When the Edain first came out of the East, the Eldar had all right and reason to consider themselves superior: They had wonderful technology, spiritual powers well above human level, superior culture and organisation, and never-aging, slowly-tiring far sighted elven bodies.
Elu Thingol chose a segregationist policy, barring men from his realm... And he was humbled when his daughter chose the mortal Beren. The Noldor on the other hand chose to confide, teach and uplift the newcomers. Only this saved them from final defeat through the sacrifice of Húrin and the mission of Eärendil.
As of the actual east-west question Originally, Tolkien set out to create a British mythology. Though the project morphed into something quite different later on, the fact that Beleriand was meant to represent Europe originally, and that Celtic mythology associated west with things like elves and Avalon, already fixed that Aman is at the west. After that the only logical choice for Sauron was to settle on the East.
tl; dr Tolkien probably did not held all races to be equal in temporal stature and created not one but two races of superior-tall-fair-wise-white-guys (the High Elves and the Númenóreans). But he did held all human beings to be equal before God, and made it so that the superior guys get their asses kicked repeatedly because of their arrogance, only to be saved by people they look down on. (The Edain, freshly come out of barbarism, and the lowly halfings no one even notices)
Regarding compass directions he does not show personal prejudice, other than what is necessitated by the source mythologies and inner logic of story, and sources plenty of evil from the north, and good people from the East
I read couple of articles about Tolkien - 2nd World War connection (for example: https://valarguild.org/varda/Tolkien/encyc/articles/t/Tolkien/TolkienandWW2.htm)
However, I don't think that we should try to find a connection there. Well, it is quite understandable, that he was affected but I doubt that he wrote his novels as an analogy. I think that we should not read his books and think how this or that fact is connected to our world. Tolkien created his own world with its own history and we should open our mind to his realm and not trying to connect these two together.
If I would try to answer your question, I would say that: No, I don't think that there is such a connection. You can find in his book what you want, as anyone of us, but it doesn't mean that the author meant that. For me, unless Tolkien himself or his family will make such a comment, there is no connection.
LOTR is was based in part on Tolkien's love for Norse mythology and culture. And I believe that in Norse mythology the North (where the cold winds came from) and the East were considered bad, unlucky, sinister etc. directions. Thus the somewhat negative vibe that the North and East have in LOTR.
And if Tolkien was familiar with Norse mythology he would also have been familiar with Norse history, including the fact that during several centuries Norsemen would go on viking raids to rob, kill, and enslave in more southern regions of Europe. Tolkien would have heard of the medieval prayer "From the fury of the Northmen protect us".
For a century of two before Tolkien wrote, Russia, the large country in the Northeast of Europe, had been feared by other Europeans for its expansionism during the time of the Tsars and latter during communist rule. So that accounts for a lot of the negative image of the north and the east in Tolkien's works.
The fact that Europe had often been invaded by nomadic horsemen from the East in historic times also had a lot to do with the negative impression of the North and the East in LOTR and other Tolkien works.
There is a belt of grassland suitable for horse riding nomads stretching thousands of miles from north east of China all the way into eastern Europe to the Hungarian plain. For thousands of years groups of nomadic horsemen would make their way slowly west along this corridor of grass, raiding neighboring sedentary people on the way. You may have heard of the Huns, the Avars, the Khazars, the Magyars, the Pechnegs, the Cumans, the Turks, and most terrifying of all, the Mongols.
Also Arabia is east of most of Europe, and Muslim Arabs from Arabia swept east and west in the 7th century in a wave of conquest. The Eastern Roman Empire managed to hold them off om Asia Minor, but they conquered westwards in North Africa so fast they conquered the Iberian Peninsula in southwest Europe in 711 and raided into France by 732. The invaders from the southeast expanded so fast that in a mere century they were invading from the southwest as well.
A number of other Muslim groups also invaded Europe in later centuries. In late Medieval and earl Modern times the Ottoman Turks conquered a large part of eastern Europe and their vassals raided far beyond the borders, killing, looting and enslaving. Millions of Europeans were captured and enslaved in eastern Europe and along the Mediterranean coasts and even in the Atlantic coast. Even distant Iceland was raided in the Turkish Abductions of 1627.
Also in some European mythologies the afterlife is lived in a blessed realm to the west, which is where the expression "to go west", meaning die, comes from.
Of course as Tolkien developed the fictional history of Middle-earth there were also a few examples of invasions by evil men from the South and the West.
When I was 13 and first read the Hobbit I considered the fact that things seemed to get worse and worse the farther North and East one went, and that evil beings seemed to come from the North and the east and force good peoples to retreat South and West, was just the opposite of what I was used to.
Because in Western movies and TV shows the East was civilized and law abiding, and the West was full of danger and anarchy, hostile Indian tribes on the warpath, and gangs of evil outlaws, and the South (or the Accursed Direction) was the direction of the Accursed Region of evil traitors and rebels.
Actually, 'the West' as a concept is given as a far more generic thing; it is the group of Free Peoples (Elves, Men, Hobbits and Dwarves, although mainly the first two). There is also a form of throwback in terms of the word 'Dúnedain' from the fact that they are descended from the Edain, more precisely the Númenóreans. So they are formed from the men whose ancestors once inhabited Aman - the Western continent and fought along with the Host of Valinor (aka Host of the West) in the war of Wrath.
However, it is true that the Easterlings, men of Rhûn, are meant to resemble Asians, and there is some prejudice when Tolkien chose evil men to resemble Asians. Furthermore, the inhabitants of Harad, Black Númenóreans, are also inspired by Africans.
So there is a bit of racism involved.
(a last note on real-life races transposed into Middle-earth; the men of Forochel are meant to stem from the Scandinavian, especially Finnish people.)