In this paper, we study the Legendre–Galerkin spectral approximation of distributed optimal control problems governed by Stokes equations. We show that the discretized control problems satisfy the well-known Babuška–Brezzi conditions by choosing an appropriate pair of discretization spaces for the velocity and the pressure. Constructing suitable base functions of the discretization spaces leads to sparse coefficient matrices. We first derive a priori error estimates in both $H^1$ and $L^2$ norms for the Legendre–Galerkin approximation of the unconstrained control problems. Then both a priori and a posteriori error estimates are obtained for control problems with the constraints of an integral type, thanks to the higher regularity of the optimal control. Finally, some illustrative numerical examples are presented to demonstrate the error estimates.