First we look for a distributional solution. Remember that, as an distribution, $\Delta u$ is defined by $$\langle\Delta u,v \rangle=-\langle\nabla u,\nabla v\rangle,\ \forall\ v\in C_0^\infty(\Omega). \tag{1}$$
From $(1)$, we can say that a solution in the distributional sense, is a function $u\in H^1(\Omega)$ with $Tu=g$ satisfying $$\int_\Omega \nabla u\nabla v=0,\ \forall\ v\in C_0^\infty(\Omega). \tag{2}$$
By density we may conclude from $(2)$ that $$\int_\Omega \nabla u\nabla v=0,\ \forall v\in H_0^1(\Omega). \tag{3}$$
This is not the only weak formulation for this problem, however, it is the one which comes from a variational problem, to wit, let $F:\{u\in H^1(\Omega):\ Tu=g \}\to \mathbb{R}$ be defined by $$Fu=\frac{1}{2}\int_\Omega |\nabla u|^2.$$
Note that $(3)$ can be rewritten as $$\langle F'(u),v\rangle=0,\ \forall\ v\in H_0^1(\Omega). \tag{4}$$
Also note that, once $\{u\in H^1(\Omega):\ Tu=g \}$ is a closed convex set of $H^1(\Omega)$ and $F$ is a coercive, weakly lower semi continuous function, we have that $F$ has a unique global minimum which satisfies $(4)$.
By not considering any kind of derivative of $u$, you can also use another weak formulation: let $C_0^{1,\Delta}(\overline{\Omega})=\{u\in C_0^1(\overline{\Omega}):\ \Delta u \in L^\infty(\Omega)\}$. A "very" weak solution, is a function $u\in L^1(\Omega)$ satisfying $$\int_\Omega u\Delta v=-\int_{\partial\Omega}g\frac{\partial v}{\partial \nu },\ \forall\ v\in C_0^{1,\Delta}(\overline{\Omega}).$$
In your setting, I mean, when $g\in H^{1/2}(\Omega)$, it can be proved that both definitions are equivalent. For references, take a look in the paper Elliptic Equations Involving Measures from Veron. It has a PDF version here. Take a look in page 8.
To conclude, I would like to adress @JLA, which gave a comment in OP; in the end, what we really want is a $H^2$ function (or more regular), because we are working with the Laplacean and it is natural to have two derivatives.
It can be proved, by using regularity theory, that $u$ is in fact in $H^2$, however, there is a huge difference between proving that $u$ is in $H^2$ after finding it in $H^1$ by the above methods and finding directly $u\in H^2(\Omega)$ by another method. Note, for example, that none of the methods above, does apply if we change $H_0^1(\Omega)$ by $H^2(\Omega)$.
Best Answer
You require $u=g$ on $\partial\Omega$ as you stated. But if $u$ is just in $L^2$, then $u$ is not well-defined on $\partial\Omega$. This is because you can change the value of an $L^2$ function on a zero measure set however you like and it'll still remain the same function. $\partial\Omega$ has 1 dimension less than $\Omega$, and so it's a zero measure set. On the other hand, if $u\in H^1$, then all is fine because you have the "trace theorem" which proved that $u$ will be well-defined on $\partial\Omega$, in the sense of a function in $L^2(\partial\Omega)$. The trace function in the theroem is a map $H^1(\Omega)\to L^2(\partial\Omega)$ which shows that every $H^1$ function has a well-defined boundary.