We enlarge $R = \Bbb Z[\sqrt{a^2d}]$ to $\,\Bbb Z[\sqrt d]\,$ because the larger ring might enjoy unique factorizarion, whereas $R$ never does when $\,a> 1.\,$ Indeed $\,w = \sqrt{a^2d}/a\not\in R$ is a $\rm\color{#c00}{proper\ fraction}$ over $R$ but $\,w^2 = (a^2d)/a^2 = d\in R,\,$ so $\,w\,$ is a root of the $\rm\color{#c00}{monic}$ polynomial $\,x^2-d\in R[x].\,$ This implies that unique factorization fails in $R$ because RRT = Rational Root Test fails, but RRT is true in any unique factorization domain (with same proof as in $\Bbb Z)$, i.e. UFDs, being gcd domains, are integrally closed.
So if there is any hope of achieving a nice divisibility theory like unique factorization then we need to adjoin all of the fractions that are roots of monic polynomials. Doing so yields what is known as the integral closure of the domain (in its fraction field), because it arises by adjoining all elements that are integral over the domain (roots of monic polynomials over it).