James Thurber, the author of "The Secret Life of Walter Mitty," never openly tells us what inspires his hero's daydreams.
The dreams are prompted by little things that Mitty does in real life. For example, his dream of being a fighter pilot is prompted by his reading about warfare in a magazine; his dream about facing a firing squad is prompted by his standing momentarily in front of a brick wall.
What really inspires Mitty's dreams? It would seem that he is stuck in a boring, mundane life, tied down to a nagging wife. His only escape is to dream.
The Mitty who appears in the daydreams is daring, calm, and highly skilled. He is a surgeon who saves lives, a fighter pilot who flies "forty kilometers through hell," and a condemned man who fearlessly faces a firing squad. All of this is in sharp contrast to the real Mitty, who can't remember a shopping list, who tangles chains around his tires, and who mutters "puppy biscuits" as he walks around a shopping district.
Various things inspire Walter's various dreams, but I think that they have one thing in common. What they have in common is that they all show him being really manly in some way. He is being brave, or smart, or sexy, or some combination of those.
So to me, this is what inspires his day dreams. He wants to have those characteristics. He clearly does not have them in his real life. This means that what inspires his day dreams is his own inadequacy and insecurity. The man who appears in the dreams is everything that the real Walter is not.