Let $f:\mathbb R\to \mathbb R$ a function. Why $f$ is measurable if $f^{-1}(B)\in \mathcal M$ for all $\mathcal B$ and is not $f^{-1}(M)\in \mathcal M$ for all $M\in \mathcal M$ ? (where $\mathcal M$ is the $\sigma -$algebra of Lebesgue measurable set and $\mathcal B$ the $\sigma -$algebra of Borel set ?
What would be the problem if we would define a measurable function by $f^{-1}(M)\in \mathcal M$ for all $M\in\mathcal M$ ?
The definition of $f:\mathbb R\to \mathbb R$ is a Lebesgue measurable function is that $\{x\mid f(x)\leq a\}$ is Lebesgue measurable for all $a\in\mathbb R$. And this is equivalent to $f^{-1}(B)\in \mathcal M$ for all Borel set $B$. Now, in more general way, if $(X,\mathcal A)$ and $(Y,\mathcal C)$ are measure space, then $$f:(X,\mathcal A)\to (Y,\mathcal C)$$ is measurable if $f^{-1}(C)\in \mathcal A$ for all $C\in \mathcal C$. So if you consider a function $f:(\mathbb R,\mathcal M)\to (\mathbb R,\mathcal M)$, then you'll have that $f$ is measurable if $f^{-1}(M)\in \mathcal M$ for all $M\in \mathcal M$.
Now, the idea behind function Lebesgue measurable is to extend a bit the class of continuous function. A natural way to extend this class is to consider function such that $f^{-1}(O)$ is Lebesgue measurable for all open $O$ (it's equivalent to the definition I gave above, i.e. to $\{x\mid f(x)\leq a\}\in \mathcal M$ for all $a\in\mathbb R$) instead of $f^{-1}(O)$ open for all open set $O$. If you consider measurability of function as $f^{-1}(M)\in \mathcal M$ for all $M\in\mathcal M$, then very pathological functions will arise... we therefore want to avoid it. But after all, why not ?