I think it is very plausible to consider Walden to be Thoreau's spiritual autobiography. Thoreau was a transcendentalist, meaning that for him nature, humanity, and divinity are all connected. As the eNotes overview states, Walden is "an ideal model for enjoying that unity. In solitude, simplicity, and living close to nature, Thoreau had found what he believed to be a better life."
Frugality and conservation were religious acts for Thoreau. In transcendentalism, God is present in every aspect of life, not just within the human soul but in the wind and in a leaf and in a drop of rain. Being alone in nature is the same as being in meditation or prayer to God. Thoreau's message is that by living according to his example, anyone can find God.