What hasn't been stated so far is that there is a difference in radiation hardening/shielding on the battlefield and radiation hardening/shielding outside the magnetic field and the thick atmosphere of the Earth.
The military is primarily interested in hardening/shielding against the cascade of primarily gamma and neutron radiation originating from the detonation of a nuclear warhead or from the fallout after a nuclear detonation. They also harden/shield agains EMP.
The Earth's magnetic field provides substantial protection from radiation derived from the Solar Wind even in LEO (ISS). As well as protecting from radiation, the Earth's magnetic field also concentrates radiation in the Van Allen belts. The full fury of the Solar Wind is felt as soon as a spacecraft leaves the Earth's magnetic field.
Beyond LEO, shielding against radiation can be problematic. A layer of dense material may actually make the problem(s) of radiation far worse. When a high energy Cosmic Ray hits the dense shielding it is blocked by colliding with the shield but that collision generates a spray of all kinds of high energy particles including x-ray, gamma and beta radiation. The Earth's dense atmosphere blocks most of that radiation so we rarely detect it on the ground. This is the reason that aircraft crew and frequent flyers are subjected to significantly higher levels of radiation than those who fly infrequently and the reason why airlines often change routes and avoid high lattitudes when a CME triggers a geomagnetic storm.
To efficiently protect the interior of a spacecraft (people and avionics) from all radiation, it is necessary to have a very thick and dense shield. What is most practial is to only stop the Solar radiation (high energy electrons, protons, x-rays, gamma radiation and beta radiation, etc.) and let Cosmic Rays and the most energetic X-rays just "slip through". This minimizes radiation damage to biological organisms, avionics and structural components. Solid materials such as metals and plastics (including semiconductors) are degraded rapidly by exposure to radiation loosing strength and flexibility. Materials usually become brittle or show the same signs as traditional mechanically induced metal fatigue. This is the primary reason that Nuclear Reactors cannot be built to be reliable "forever" and critical components are excessively overengineered so they will have a useful life (duration) in a substantially higher radiation environment even if not within the actual core.
Since the goal is to stop the typical radiation from the solar wind or an onboard nuclear reactor or RTG, one of the reasons that water is often suggested is that it is relatively effective at stopping most radiation except for Cosmic Rays and the most energetic X-Rays.Water is easily replaced and does not suffer from the materials failures consistent with solid materials such as metals and plastics.
Creating a local magnetic onboard a spacecraft has some advantages and perils. Just as the magnetic field of the Earth traps solar radiation and channels it to the north and south poles, similar enhanced radition would occur at the north and south poles of a locally created magnetic field. A local magnetic field would also create mini Van Allen belts of trapped radiation as well. The creation of a local magnetic field could shield the bulk of the spacecraft from the charged particle radiation from the Sun but would require additional radiation shield where the poles of the magnetic field intersect the spacecraft. It would also need to be strong enough that the mini Van Allen belts would be far enough from not to be a threat.