How to apply a Hadamard gate to one qubit in a 2-qubit system?
The problem is in the order of the transformations. The first transformation you apply in the circuit is $I\otimes X$, whereas in the computation of $M$ it is actually the last. Recall that the rightmost operator is the first to act on the state (matrix multiplication is not commutative).

Fixing that we obtain:

$$
M=(H\otimes I)(I\otimes X)CNOT(I\otimes X) = 
\begin{bmatrix}
H &amp; 0 \\
0 &amp; H
\end{bmatrix}
\begin{bmatrix}
X &amp; 0 \\
0 &amp; X
\end{bmatrix}
\begin{bmatrix}
I &amp; 0 \\
0 &amp; X
\end{bmatrix}
\begin{bmatrix}
X &amp; 0 \\
0 &amp; X
\end{bmatrix}=
\begin{bmatrix}
H &amp; 0 \\
0 &amp; H
\end{bmatrix}
\begin{bmatrix}
X &amp; 0 \\
0 &amp; X
\end{bmatrix}
\begin{bmatrix}
X &amp; 0 \\
0 &amp; I
\end{bmatrix}=
\begin{bmatrix}
I &amp; I \\
I &amp; -I
\end{bmatrix}
\begin{bmatrix}
I &amp; 0 \\
0 &amp; X
\end{bmatrix}=
\begin{bmatrix}
I &amp; X \\
I &amp; -X
\end{bmatrix}
$$

Now applying $M$ on $|00\rangle$ will yield the right result.