The group $H^2(G,M)$ classifies different types of extensions than $\operatorname{Ext}^1(G,M)$. On the one hand, $H^2(G,M)$ classifies extensions

$$M\hookrightarrow H\twoheadrightarrow G$$

where $H$ may be non-abelian, and the action of $H$ on $M$ by conjugation is encoded in the $G$-module structure of $M$. On the other hand, $\operatorname{Ext}^1(G,M)$ classifies extensions

$$M\hookrightarrow A\twoheadrightarrow G$$

where $A$ is an abelian group, in particular $A$ acts trivially on $M$ by conjugation, i.e. $M$ can only be regarded as a trivial $G$-module here.

Even if you regard $M$ as a trivial $G$-module in both cases, $H^2(G,M)$ and $\operatorname{Ext}^1(G,M)$ may be different due to the existence of non-abelian but central extensions. In general, there is a universal coefficient split short exact sequence

$$\operatorname{Ext}^1(G,M)\hookrightarrow H^2(G,M)\twoheadrightarrow \operatorname{Hom}(H_2G,M).$$

You can find this in most books on group cohomology. The first morphism represents the inclusion of abelian extensions into central (but possibly non-abelian) extensions (recall that $M$ carries here the trivial $G$-module structure). The group $\operatorname{Hom}(H_2G,M)$ measures the amount of really non-abelian central extensions of $G$ by $M$.

Fortunately, $H_2G$ is very easy to compute, it is the exterior square $H_2G=\wedge^2G$, i.e. the quotient of $G\otimes G$ by the relations $g\otimes g=0$, $g\in G$. This functor is quadratic, $$\wedge^2(G_1\oplus G_2)=\wedge^2(G_1)\oplus (G_1\otimes G_2) \oplus \wedge^2(G_2)$$
and vanishes on (finite or infinite) ciclyc groups $\wedge^2(\mathbb{Z}/n)=0$, $n\in\mathbb Z$. This gives a recipe to compute $H_2G$ for any finitely generated abelian group. In particular, if you take $G=(\mathbb{Z}/2)^2$ and $M=\mathbb{Z}/2$ you get

$$\operatorname{Ext}^1(G,M)=(\mathbb{Z}/2)^2,\qquad \operatorname{Hom}(H_2G,M)=\mathbb Z/2.$$
Hence $$H^2(G,M)=(\mathbb{Z}/2)^3.$$