The spins of the terrestrial planets likely arose as the planets formed by the accretion of planetesimals. Depending on the masses of the impactors, the planet's final spin can either be imparted by many small bodies (ordered accretion), in which case the spin is determined by the mean angular momentum of the impactors, or by a few large bodies (stochastic accretion), in which case the spin is a random variable whose distribution is determined by the root-mean-square angular momentum of the impactors. In the case of ordered accretion, the planet's obliquity is expected to be near 0^circ or 180^circ, whereas, if accretion is stochastic, there should be a wide range of obliquities. Analytic arguments and extensive orbital integrations are used to calculate the expected distributions of spin rate and obliquity as a function of the planetesimal mass and velocity distributions. The results imply that the spins of the terrestrial planets are determined by stochastic accretion.