The magnetosphere deflects much of the solar wind and guides some charged particles into polar regions. The atmosphere provides additional protection and is central to conditions at the surface.
Habitability is a system of interacting conditions. A magnetic field alone does not establish that a planet can support life.