Contradictory theoretical results for oxygen vacancies in SrTiO$_3$ (STO) were often related to the peculiar properties of STO, which is a $d^0$ transition metal oxide with mixed ionic-covalent bonding. Here, we apply, for the first time, density functional theory (DFT) within the extended Hubbard DFT+$U$+$V$ approach, including on-site as well as inter-site electronic interactions, to study oxygen-deficient STO with Hubbard $U$ and $V$ parameters computed self-consistently via density-functional perturbation theory. Our results demonstrate that the extended Hubbard functional is a promising approach to study defects in materials with electronic properties similar to STO. Indeed, DFT+$U$+$V$ provides a better description of stoichiometric STO compared to standard DFT or DFT+$U$, the band gap and crystal field splitting being in good agreement with experiments. In turn, also the description of the electronic properties of oxygen vacancies in STO is improved, with formation energies in excellent agreement with experiments as well as results obtained with the most frequently used hybrid functionals, however at a fraction of the computational cost. While our results do not fully resolve the contradictory findings reported in literature, our systematic approach leads to a deeper understanding of their origin, which stems from different cell sizes, STO phases, the exchange-correlation functional, and the treatment of structural relaxations and spin-polarization.