This is the first investigation of yttrium (Y) and erbium (Er) co-doped hydroxyapatite (HAp) structures, conducted using theoretical and experimental procedures. By using a wet chemical method, the materials were synthesized by varying the concentration of Y amounts of 0.13, 0.26, 0.39, 0.52, 0.65, and 0.78 at.% every virtual 10 atoms of calcium, whereas Er was kept fixed at 0.39 at.%. Spectroscopic, thermal, and in vitro biocompatibility testing were performed on the generated samples. Theoretical calculations were carried out to compute the energy bandgap, density of states, and linear absorption coefficient. The effects of Y concentration on thermal, morphological, and structural parameters were investigated in detail. Raman and Infrared (FTIR) spectroscopies confirmed the formation of the HAp structure in the samples. Theoretical investigations indicated that the increasing amount of Y increased the density from 3.1724 g cm−3 to 3.1824 g cm−3 and decreased the bandgap energy from 4.196 eV to 4.156 eV, except for the sample containing 0.39 at. % of the dopant, which exhibited a decrease in the bandgap. The values of linear absorption appeared reduced with an increase in photon energy. The samples exhibited cell viability higher than 110%, which revealed excellent biocompatibility for biological applications of the prepared samples.