We investigate the superfluid--Mott-insulator quantum phase transition of spin-1 bosons in an optical lattice created by pairs of counterpropagating linearly polarized laser beams, driving an $F_g=1$ to $F_e=1$ internal atomic transition. The whole parameter space of the resulting two-component Bose-Hubbard model is studied. We find that the phase transition is not always second order as in the case of spinless bosons, but can be first order in certain regions of the parameter space. The calculations are done in the mean-field approximation by means of exact numerical diagonalization as well as within the framework of perturbaton theory.