What was Dirac's motivation to study hypothetical magnetic monopoles? The equation $$\boldsymbol{\nabla}\cdot\textbf{B}(\textbf{r})=0\tag{1}
$$ dictates that there can be no isolated magetic monopole. What was then the motivation for Dirac to consider the consequences for a hypothetical magnetic monopole? 
Using quantum mechanics, Dirac was able to prove that if magnetic monopoles are ever found in nature, they must be quantized in terms of $e,\hbar,c$. But quantum mechanics does not predict the existence of magnetic monopoles. 
What was his motivation to consider a monopole when it is already forbidden by (1)? 
 A: Curie's Early Contribution
It was first pointed out that magnetic monopoles are a possibility by Pierre Currie in his paper, which in English is titled, On the possible existence of magnetic conductivity and free magnetism in which the concept of a monopole was described. He notes in the opening sentence,

Le parrallélisme des phénomènes électriques et magnétiques nous améne naturellement á nous demander si cette analogie est plus compléte.

That is to say - in English - the parallelism that exists between electric and magnetic phenomena leads us to consider if it can be strengthened, that is, to consider a modified form of Gauss' law for the magnetic field, since Maxwell's equations otherwise tie $\vec E$ and $\vec B$ together beautifully. 
Dirac's Quantisation Condition & Solitons
Dirac's paper explores the consequences of monopoles and in particular that they imply quantisation of electric charge. In particular, this can be shown by considering a theory with a Lagrangian of the form,
$$\mathcal L = \frac{1}{2e^2}F_{\mu\nu}F^{\mu\nu} + \frac{1}{e^2} \left( \mathcal D_\mu \phi\right)^2$$
with a scalar field $\phi^a_b$ transforming in the adjoint representation of $SU(N)$. We can set $\langle \phi \rangle = \vec \phi \cdot \vec H$ where $\vec H$ is a basis for the subalgebra of $\mathfrak{su}(N)$. Not getting into too many details, there is a condition to break the gauge symmetry to the maximal torus, $U(1)^{N-1}$.
The reason I have used this formalism is to show that monopoles may be seen as solitons, which have long been of interest to physicists. They are supported by the aforementioned v.e.v. and are of the form $\langle \phi \rangle = \langle \phi (\theta,\varphi)\rangle$ with $\theta,\varphi$ coordinates on the boundary $S^2_\infty$. The magnetic field turns out to be of the form,
$$B_i = \vec g \cdot \vec H(\theta,\varphi) \frac{\hat r_i}{4\pi r^2}.$$
Fixing the v.e.v. to be constant at infinity, we may write,
$$B_i = \mathrm{diag}(g_1,\dots,g_N)\frac{\hat r_i}{4\pi r^2}$$
with the condition $\sum g_a = 0$ since the field lies in $\mathfrak{su}(N)$. To arrive at the quantisation condition one may find the corresponding 4-potential, and for gauge transformations to be single-valued, we have that,
$$\exp (i\vec g \cdot \vec H) = 1$$
which is satisfied only for $g_a \in 2\pi \mathbb Z$ in units where $e= 1$, equivalent to the Dirac quantisation condition. The entire point of Dirac's paper is to show the implications of the existence of monopoles, and it builds on a concept already described by Curie.
Moreover, as this exposition has shown, monopoles can be seen as solitons and these were of interest to John Scott Russell before Dirac's publications on monopoles.
A: Dirac's argument is a purely theoretical one while equation $(1)$ in your question is based on experiments: it does not forbid the existence of a magnetic monopole; it just says it is not observed (yet). 
Therefore it is clear that Dirac's motivation was to show theoretically that it is a worthwhile effort to look for magnetic monopoles that, if found, can both explain the quantized nature of the electric charge and also make Maxwell's equations fully symmetric.
