Linearly polarized light with an energy of 3.1 eV has been used to excite highly spin-polarized electrons in an ultrathin film of face-centered-tetragonal cobalt to majority-spin quantum well states (QWS) derived from an sp band at the border of the Brillouin zone. The spin-selective excitation process has been studied by spin- and momentum-resolved two-photon photoemission. Analyzing the photoemission patterns in two-dimensional momentum planes, we find that the optically driven transition from the valence band to the QWS acts almost exclusively on majority-spin electrons. The mechanism providing the high spin polarization is discussed by the help of a density-functional theory calculation. Additionally, a sizable effect of spin-orbit coupling for the QWS is evidenced.