Summary: tor was written to help e.g. informants securely get information back to the US government; but an anonymity network that only carries spies' information back to the US government is not terribly useful, so they opened it up. Yes, tor was made for spying, but not (necessarily) for spying on tor users.