Hartshorne makes this sound like a coincidence: we us Cech cohomology on the usual open affine cover $\mathcal{U}$ to get the chain complex
$$\check{C}^\bullet\left(\mathcal{U}, \bigoplus_{n \in \mathbb{Z}} \mathcal{O}(n)\right): 0 \to \bigoplus_i S_{x_i} \to \cdots \to \bigoplus_i S_{x_0\cdots\hat{x_i}\cdots x_r} \to S_{x_0 \cdots x_r}\to 0,$$
calculate the cokernel of the last map to obtain the cohomology groups $\check{H}^r(\mathcal{U}, \mathcal{O}(n))$, and then observe that it's one dimensional when $n = -r - 1$. Voilà! What a coincidence!
Surely there's an actual reason here, though. What is it?