I think that all of these three authors were writing at a particular moment in history when there was a widespread crisis of confidence in the values upon which Western civilisation was founded.
It was hard to maintain any faith in the continuity and value of human civilisation in an era saw the horrors of World War I...followed by the global influenza pandemic of the early 1920s, the Great Depression, the rise of Stalinist Russia and the first stirrings of Fascism in Germany.
It is hard to overstate the impact that World War I had on the imaginations of people living in the 1920s and 1930s. The Great War showed that the values of Western civilisation were extremely fragile -- there was a renewed sense that barbarism lurked just beneath the surface, ready to erupt at any time. The stuffy self-satisfaction of the late Victorian era was well and truly dead.
However, there were also more subtle influences on all three writers. This was also an era when there were upheavals in the artistic and intellectual worlds. It was the era when representation of reality in the visual arts was starting to be challenged by the rise of abstraction. This was the age of the Surrealist movement and the Dada movement.
It was also an era when the structure of the novel and the poem was being challenged by the rise of modernism. It was the age of James Joyce and T.S. Elliot. There was a sense that Romanticism of any kind was shameful and potentially dangerous -- there was a sense that the Romantic worldview had contributed to the nationalism that in turn led to the tragedies of Ypres and the Somme. Consider this quote from Clark AShton Smith's essay 'On Fantasy':
We have been told that literature dealing with the imaginative and fantastic is out of favour among the Intellectuals, whoever they are. Only the Real, whatever that is or may be, is admissible for treatment; and writers must confine themselves to themes well within the range of statisticians, lightning calculators, Freud and Kraft-Ebbing, the Hearst and McFadden publications, NRA, and mail-order catalogues. Chimeras are no longer the mode, the infinite has been abolished; mystery is obsolete, and sphinx and medusa are toys for children. The weird and the unearthly are outlawed, and all mundane impossibilities (which, it may be, are the commonplaces of the Pleinds) have been banished to some limbo of literalistic derision. One may write of horses and hippopotomi but not of hippogriffs; of biographers, but not of ghouls; of slum-harlots or the hetairae of Nob Hill but not of succubi. In short, all pipe-dreams, all fantasies not authorized by Freudianism, by sociology, and the five senses, are due for the critical horse-laugh, when, through ignorance, effrontery, or preference, they find a place in the subject matter of some author unlucky enough to have been born into the age of Jeffers, Hemingway, and Joyce.
It was an era when theories of Freud permeated the academic world in the same way that the theories of Derrida and Foucalt do today. Both Tolkien and Lovecraft certainly had a dislike of these trends, but each of them responded in a different way.
The importance of courage in the face of overwhelming odds is a vital theme in the works of Tolkien precisely because he felt that Western civilisation was in danger of losing its nerve. Through their actions, his characters validate the relevance of virtues such as heroism, loyalty, and hope even in the darkest of times. It is noteworthy that those characters who give in to despair (Denethor and - to a lesser extent - Theoden) both come to a nasty end.
By contrast, Lovecraft translated his concerns about the direction in which civilisation was heading into into a sense of horror.
Robert E. Howard stands somewhere between these two extremes. There is a sense of moody despair at the ultimate transience of human existence... but also a sense of triumphant pride in the power of human endurance in the face of an uncaring cosmos.
As an aside, I've always thought it was significant that Lovecraft was writing at a time when Quantum Mechanics was starting to overturn classcal Newtonian physics. Lovecraft had a deep interest in the physical sciences and was aware of contemporary debates about the nature of reality at the atomic level. From memory, I think that he even mentions the work of Heisenberg in 'Dreams in the Witch House'.
There are few better expressions of the Lovecraftian worldview than that of the physicist Erwin Schrodinger pointed out the "the universe is not only stranger than we imagine; it is staranger than we can imagine"