Why the Spec functor is a natural thing; this is not so clear (at least to me) from the definition in Hartshorne. Bas Edixhoven made me see the light by saying that Spec is adjoint to the global sections functor from locally ringed spaces to commutative rings: $\mathrm{Hom}_{\mathrm{Rings}}(A,\Gamma(X,{\cal O}_X))\cong\mathrm{Hom}_{\mathrm{LRS}}(X,\mathrm{Spec}(A))$. Exercise II.2.4 of Hartshorne asks you to prove this with locally ringed spaces replaced by schemes, but this is less clarifying.
Post Made Community Wiki