What Thoreau is saying here overall is essentially that money cannot buy happiness. It cannot buy what you really need in order to be a fulfilled human being.
The first sentence can be paraphrased something like this:
The only thing that you can buy with money you don't need is things that you don't need.
The second sentence can be paraphrased something like this:
The one thing that your soul really needs is something that cannot be bought with money.
So overall he is saying that we should not try hard to get a lot of money. This was a major idea of transcendentalism -- if we chase money too much, we will never become truly happy.