The dual of the Sobolev space $W^{k,p}$
The dual of the Sobolev space if defined to be
$$(W^{k,p}(\Omega))' = W_0^{-k,p'}(\Omega)$$
where $\frac 1 p + \frac 1 {p'} = 1$.
Why makes this definition sense, especially why do we have $L^{p'}$-functions on right side that vanish on $\partial \Omega$?
I'll use one-dimensional $\Omega=(-1,1)$, $p=2$, and $k=1$ for simplicity. The general idea is the same.
When $k\ge 1$, the derivative operator $\frac{d}{dx}$ maps $W^{k,2}$ onto $W^{k-1,2}$. This is such a natural property that we should expect it to hold for negative indices too. In particular, $W^{-1,2}$ should consist precisely of the distributional derivatives of $L^2$ functions.
What does it mean for distribution $T$ to be the derivative of $L^2$ function $g$? It means that $$T\varphi=-\int_{-1}^1 g\varphi'\tag1$$ for all test functions $\varphi\in C^\infty_c(\Omega)$. By Cauchy-Schwarz, $|T\varphi|\le \|g\|_{L^2} \|\varphi\|_{W^{1,2}}$. Therefore, the functional $T$ extends to the completion of $ C^\infty_c(\Omega)$ in $W^{1,2}$ norm. Which is precisely $W^{1,2}_0(\Omega)$. We thus arrive at the identification of distributional derivatives of $L^2$ functions with the elements of $W^{1,2}_0(\Omega)'$.
Now that we see that vanishing on the boundary came from test functions having this property, it is natural to ask: why do we insist on test functions vanishing on the boundary? The answer is that we want to define distributions that live on $\Omega$, not somewhere else (in particular, not on $\partial \Omega$). Whatever "distribution on $\Omega$" means, it must be something we can identify by testing it against the functions supported in $\Omega$.
If we take the dual of $W^{1,2}(\Omega) $, we let in some distributions that vanish in $\Omega$, yet are not identically zero. For example, the functional $\varphi\to \varphi(1)$ belongs to $W^{1,2}(\Omega)' $. Clearly, this should not be an element of any function space on $\Omega$.
Remark. The surjectivity of differentiation comes in handy when one considers the Poisson equation with homogeneous boundary values: $\Delta:W_0^{1,2}(\Omega)\to W^{-1,2}(\Omega)$ turns out to be an isomorphism.