My examples are basically the same as Louis's and the original poster, but maybe the pattern is helpful to see.
If either $I$ or $M$ is cyclic, then $A=B$. Hence we need to choose both $I$ and $M$ non-cyclic. The easiest choice usually works:
Let $P$ be a non-principal ideal of $R$, and take $I=P$ and $M=P$ so that $B=P^2$. Usually $B \neq A$.
Example 1: If $R=\mathbb{Z}[\sqrt{-17}]$ and $I=M=(3,1+\sqrt{-17})$, then $1+\sqrt{-17} \in B \setminus A$.
Proof: Check that $I=\{ (3a+b) + b\sqrt{-17} : a,b \in \mathbb{Z} \}$, or, in other words, that I have given an integral basis. Check that $N:R\to \mathbb{Z}:a+b\sqrt{-17}\mapsto a^2+17b^2$ is multiplicative and zero iff $a+b\sqrt{-17}=0$. Check that $N( (3a+b) + b\sqrt{-17} ) = 3(a+b)^2 + 6a^2 + 15b^2$. Notice that this is which is minimized (with value $9$) when $a=1$, $b=0$ (other than $a=b=0$), so that $N(im) = N(i) N(m) \geq 9 \cdot 9 = 81$. Of course $N(1+\sqrt{-17}) = 18$, so $1+\sqrt{-17} \notin A$ (see also this question). On the other hand $1+\sqrt{-17} = ((1+\sqrt{-17})-6)(3) - (1+\sqrt{-17})^2 \in B$. $\square$
Example 2: If $R=\mathbb{Q}[x,y]$ and $I=(x,y)$, then $x^2 + y^2 \in B \setminus A$.
Proof: Clearly $x^2 + y^2 \in B=(x^2,xy,y^2)$. If $x^2+y^2 = fg$ we can WLOG assume the coefficients on $x$ are both $1$, so $f=x+ay+i$ where $i \in I^2$ and $g=x+by+j$ where $j \in I^2$, so that $fg = (x+ay+i)(x+by+j) = x^2 + (a+b)xy + aby^2 + k$ where $k \in I^3$. Hence we seek a solution for $a+b=0$ and $ab=1$, but this is equivalent to $a=-b$ and $a^2=-1$, which has no solutions in $\mathbb{Q}$ (nor in lots of other fields). Here I did use that $\left(\mathbb{Q}xy \oplus \mathbb{Q}y^2\right) \cap I^3 = 0$. $\square$
Example 3: If $R=\mathbb{Z}[x]$ and $I=(2,x)$, then $4+x^2 \in B \setminus A$.
Proof: Clearly $4+x^2 \in B=(4,2x,x^2)$. We describe $I$ as the polynomials with even value at $0$. Again $4+x^2 = (2+ax+i)(2+bx+j) = 4+(a+b)x+abx^2 +k$ and again $a+b=0$, $ab=1$ has no solution in integers. $\square$
This next example is neat because $B$ is cyclic, even though $I$ and $M$ are not. We still get $A\neq B$.
Example 4: If $R=\mathbb{Z}[\sqrt{-5}]$ and $I=(3,1+\sqrt{-5})$, then $-2+\sqrt{-5} \in B \setminus A$.
Proof: Check that $I=\{ (3a+b) + b\sqrt{-5} : a,b \in \mathbb{Z} \}$, that $N(a+b\sqrt{-5})=a^2 +5b^2$ is a norm, that $N((3a+b)+b\sqrt{-5}) = 3(a+b)^2 + 6a^2 + 3b^2$ takes its minimum on $I \setminus \{0\}$ at $a=0$, $b=1$ with value $6$. Thus $A\setminus \{0\}$ has minimum norm $36$, but $-2+\sqrt{-5}$ has norm $9$, so $-2+\sqrt{-5} \notin A$. Of course, $-2+\sqrt{-5} = -3^2 -(1+\sqrt{-5})^2 + 3(1+\sqrt{-5}) \in B$. $\square$
Nonexample: Now just because $I=M$ is non-principal does not mean $A \neq B$, since $I^2$ might itself be too simple. For example $R=\mathbb{Q}[x,y]/(x^2,xy,y^2)$ with $I=(x,y)$, then $A=B=0$.
I'm not aware of any simple necessary or sufficient criteria not already mentioned.