Amazon is worth money right now. Just like a lawn mower doesn't turn a profit on its own, but it is still worth something.
In the long term view, which Amazon definitely takes, this current process is just there to fund the final business. Which is providing infrastructure. It uses its current operations as a way to fund the build out of that infrastructure. The future of Amazon, in my opinion, is not selling books etc, but providing someone with the infrastructure to sell books. Its using its current book sales etc to fund that build out.