The neutron stars associated with spinning pulsars have magnetic fields whose strengths are measured in hundreds of trillions of gauss. By comparison the strength of the Sun's field is about 1 gauss overall, and 1000 to 10000 gauss in sunspots. When a star becomes a supernova, part of its original magnetic field is ejected in the gas that is ejected by the explosion. But some of the field, trapped as it is by its connection with charged plasma, collapses into the core of the star which is imploding to become the neutron star. The strength of the magnetic fields in either situation are determined by the density of the plasma, so that the part which is dragged into interstellar space by the ejected gas becomes weaker, while the part that is dragged into the core is amplified. In the latter case, the field can get amplified by trillions of times, and this is the field we ultimately see in the neutron star.
When a neutron star develops, the original plasma containing neutrons, protons and electrons, evolves quickly into a new state. Because of the enormous pressures involved, most of the electrons are forced into the protons causing them to transform into neutrons. The 'neutronization' of matter continues until only 1 percent or less of the original protons and electrons survive. The bulk of the core is now almost 100 percent neutrons. At even higher densities, some theoreticians believe the core of the neutron star might be forced into a pure quark state as the neutrons themselves are crushed out of existence. So, even a neutron star contains some trace quantities of protons and electrons at its surface, in the outer few meters or centimeters of its crust. It is these charges particles that provide the currents needed to maintain the original magnetic field.