  Different dopants with their specific dopant concentration can be utilized to
produce ferroelectric HfO$_2$ thin films. In this work it is explored for the
example of Sr in a comprehensive first-principles study. Density functional
calculations reveal structure, formation energy and total energy of the Sr
related defects in HfO$_2$. We found the charge compensated defect including an
associated oxygen vacancy Sr$_\text{Hf}$V$_\text{O}$ to strongly favour the
non-ferroelectric, tetragonal P4$_\text{2}$/mnc phase energetically. In
contrast, the uncompensated defect without oxygen vacancy Sr$_\text{Hf}$
favours the ferroelectric, orthorhombic Pca2$_\text{1}$ phase. According to the
formation energy the uncompensated defect can form easily under oxygen rich
conditions in the production process. Low oxygen partial pressure existing over
the lifetime promotes the loss of oxygen leading to V$_\text{O}$ and, thus, the
destabilization of the ferroelectric, orthorhombic Pca2$_\text{1}$ phase
accompanied by an increase of the leakage current. This study attempts to
fundamentally explain the stabilization of the ferroelectric, orthorhombic
Pca2$_\text{1}$ phase by doping.
