From base-4.6.0.1 [1] the filterM is implemented like this:

filterM          :: (Monad m) => (a -> m Bool) -> [a] -> m [a]
filterM _ []     =  return []
filterM p (x:xs) =  do
   flg <- p x
   ys  <- filterM p xs
   return (if flg then x:ys else ys)

So
filterM (\x -> [True, False]) [1,2] is

filterM (\x -> [True, False]) (1:[2])
do
    flg <- (\x -> [True, False]) 1
    ys <- filterM (\x -> [True, False]) [2]
    return (if flg then x:ys else ys)

do
    flg <- [True, False]
    ys <- [[2], []]
    return (if flg then 1:ys else ys)

You get the idea. You'll end up with [[1,2],[1],[2],[]]

Hope this helps,
Alexey Shmalko

[1] https://hackage.haskell.org/package/base-4.6.0.1/docs/src/Control-Monad.html