So let's look at the types of functions involved.
Prelude> :t (\i -> case i of { True -> (1+) ; False -> (0+) })
(\i -> case i of { True -> (1+) ; False -> (0+) }) :: (Num t) => Bool -> t -> t
Prelude> :t foldl
foldl :: (a -> b -> a) -> a -> [b] -> a
So, for your list Bools, b is Bool, but the function you use has Boolas the first argument, not the second. The accumulated value is the first argument. So instead, you could do
foldl (\acc p -> case p of { True -> acc + 1 ; False -> acc }) 0
, , flip
Prelude> :t flip
flip :: (a -> b -> c) -> b -> a -> c
foldl (flip (\i -> case i of
True -> (1+)
False -> (0+)
)) 0
: foldl (flip ((+) . fromEnum)) 0