The $5f$-based ferromagnet $\mathrm{U}{\mathrm{Ga}}_{2}$ with the Curie temperature ${T}_{\mathrm{C}}=125\phantom{\rule{0.16em}{0ex}}\mathrm{K}$ was investigated by x-ray absorption spectroscopy (XAS) and x-ray magnetic circular dichroism (XMCD) experiments at the $\mathrm{U}--{M}_{4,5}$ and Ga--K edges. The position of the $\mathrm{U}--{M}_{4}$ white line, determined in the high-energy resolution fluorescence detection XAS, suggests that $\mathrm{U}{\mathrm{Ga}}_{2}$ is neither a localized $5{f}^{2}$ nor an itinerant system with $5f$ occupancy close to ${n}_{5f}=3$. The analysis of the acquired ${M}_{4,5}$ XANES and XMCD spectra indicates the $5f$ occupancy close to 2.5 and a large orbital magnetic moment of the uranium $5f$ states (3.18 ${\ensuremath{\mu}}_{\mathrm{B}}$) that is partly compensated by the antiparallel spin moment (1.31 ${\ensuremath{\mu}}_{\mathrm{B}}$). Thus, the total $5f$ magnetic moment of 1.87 ${\ensuremath{\mu}}_{\mathrm{B}}$ is obtained, which is smaller than the known bulk magnetization of 3.0 ${\ensuremath{\mu}}_{\mathrm{B}}$ per formula unit, while the magnetic moments of the Ga atoms are negligible. Several methods based on density-functional theory were applied and the obtained results were compared with XAS spectral features, the Sommerfeld coefficient of the electronic specific heat, and the size of the U moments and $5f$ occupancies. A clear correlation is revealed between the $\mathrm{U}--{M}_{4}$ white-line position of three metallic uranium compounds and the calculated uranium ionicity. It is demonstrated that only electronic structure methods taking appropriate care of orbital magnetism and related atomic multiplet effects can successfully describe all considered properties.