Hayao Miyazaki was interviewed about "Spirited Away" just before the film was released in Japan, and via translation, the writer-director elaborated on the inspiration behind the film. Of particular note was Miyazaki's explanation for how he chose the setting of the movie and why he thought it was a place where the spirits of Japan might gather.
"For me, a bathhouse is a mysterious place in town. The first time I saw an oil painting was in a bathhouse," Miyazaki explained. "And there was a small door next to the bathtub. I wondered what was behind that door." When put this way, the inspiration sounds similar to how a young Shigeru Miyamoto imagined his famous "The Legend of Zelda" series from his childhood imagination while playing and exploring the hillsides of Japan (via NPR).
Miyazaki went on to elaborate on why he thought the fading gods of his homeland might choose that spot as a social hub as well. "It would be fun if there were such a bathhouse. It's the same as when we go to hot springs," the animation guru mused. "Japanese gods go there to rest for a few days, then return home saying they wished they could stay for a little while longer. I was thinking that it's tough being a Japanese god today," Miyazaki concluded.