To unravel the underlying performance of MOFs in CO2 adsorption and separation, grand canonical Monte Carlo (GCMC) simulation combined with density functional theory (DFT) was used to investigate the adsorption and separation properties of CO2/N2 and CO2/CH4 mixtures on UiO-66s, including UiO-66 with and without defects and metal-doping functionalization. OH-UiO-66 was constructed according to previous reports by replacing organic linkers with hydroxyl groups, and it showed a slightly higher selectivity for CO2/CH4 and CO2/N2 at the measured pressure due to its stronger adsorbate-adsorbent interactions but weaker steric hindrance. Metal-doped UiO-66s, OM-UiO-66 (M = Be, Mg, Ca, Sr, and Ba), were theoretically fabricated by doping metal atoms on the hydroxyl groups in OH-UiO-66. They demonstrated much higher selectivity for CO2/CH4 and CO2/N2 than UiO-66 and OH-UiO-66 owing to their stronger interaction between the doped metal atoms and CO2 molecules and a binding energy of -81.36 kJ mol-1. Notably, their adsorption was dominated by electrostatic potential. This can be attributed to the presence of new adsorption sites, including hydroxyl groups and doped metal sites, as revealed by the density contribution of adsorbates in UiO-66s and electrostatic interaction contribution to the adsorption process. Thus, it can be concluded that metal doping can effectively enhance the selectivity for CO2/N2 and CO2/CH4 in UiO-66 at 298 K and 100 kPa.