SrTiO$_3$-based two-dimensional electron gases (2DEGs) can be formed through the deposition of epitaxial oxides like LaAlO$_3$ or of reactive metals such as Al. Such 2DEGs possess a finite Rashba spin-orbit coupling that has recently been harnessed to interconvert charge and spin currents through the direct and inverse Edelstein and spin Hall effects. Here we compare the formation and properties of 2DEGs generated in SrTiO$_3$ by the growth of Al, Ta and Y ultrathin films by magnetron sputtering. By combining in situ and ex situ X-ray photoelectron spectroscopy (XPS) we gain insight into the reduction of the SrTiO$_3$ and the appearance of Ti$^{3+}$ states associated with 2DEG formation, its reoxidation by exposure to the air, and the transformation of the metal into its binary oxides. We extract the carrier densities through magnetotransport and compare them with the XPS data. Finally, working with samples covered by an extra layer of NiFe, we perform spin-pumping ferromagnetic resonance experiments and investigate spin-charge conversion as a function of gate voltage. We identify trends in the data across the different sample systems and discuss them as a function of the carrier density and the transparency of the metal oxide tunnel barrier.