Big bang nucleosynthesis (BBN) is the standard model theory for the production of the light nuclides during the early stages of the universe, taking place for a period of about 20 minutes after the big bang. Deuterium production, in particular, is highly sensitive to the primordial baryon density and the number of neutrino species, and its abundance serves as a sensitive test for the conditions in the early universe. The comparison of observed deuterium abundances with predicted ones requires reliable knowledge of the relevant thermonuclear reaction rates, and their corresponding uncertainties. Recent observations reported the primordial deuterium abundance with percent accuracy, but some theoretical predictions based on BBN are at tension with the measured values because of uncertainties in the cross section of the deuterium-burning reactions. In this work, we analyze the S-factor of the D(p,$gamma$)$^3$He reaction using a hierarchical Bayesian model. We take into account the results of eleven experiments, spanning the period of 1955--2021; more than any other study. We also present results for two different fitting functions, a two-parameter function based on microscopic nuclear theory and a four-parameter polynomial. Our recommended reaction rates have a 2.2% uncertainty at $0.8$~GK, which is the temperature most important for deuterium BBN. Differences between our rates and previous results are discussed.