Leukemia is a disease of the bone marrow, creating excessive development on white blood cells. Despite that, they remain vulnerable to infection, just as you mentioned. The answer to your question is two fold. The mutation that causes the cells to develop rapidly create mutated white blood cells that don't really know how to do their job, so to speak. The other reason is that the bone marrow gets crowded, and forces the cells into circulation before their fully developed. This is like giving a gun to a 10 year old and sending him to war. It's just not going to work.
In order to have a fully functioning immune system, you need cells that are both functional and mature. Sadly, people with leukemia have neither.
I'm a medical oncology nurse.