Hi Susan B
The Sun is a spinning, churning mass of hot ionized material ( called a plasma). It generates magnetic fields down in side which rise up to and through the surface of the Sun. This magnetic activity causes sunspots and solar activity in general are the result of magnetic field. So sunspots don't "become" magnetic"; they are inherently magnetic.
Does this answer your question?
Paulett