How Mars have so less magnetic field if it spins? Moving charges have magnetic fields. If Mars spins, it moves and so the core with it and so will the electrons inside it. Then why it needs liquid core to have strong magnetic field, what about the spinning of the planets, especially those which spin faster and have solid cores?
 A: Sure - the electrons rotating with mars make a magnetic field, but so do the protons. Since mars is electrically neutral, those magnetic fields cancel out.
Rotating an electrical neutral planet (or any object really) won't produce a magnetic field. Earth's magnetic field is created by some self-sustaining that is poorly understood - this area of research is known as Dynamo Theory. A faster rotating planet doesn't necessarily mean a stronger magnetic field.
A: 
Then why it needs liquid core to have strong magnetic field, what about the spinning of the planets, especially those which spin faster and have solid cores?

You appear to be reading very old information that suggests Mars' core has frozen completely solid. It hasn't. A completely solid core is inconsistent with observations made of Mars' gravity field and, more recently, with seismometers on Mars. Mars has a partially molten core (i.e., a solid inner core and a liquid outer core), just as does the Earth.
Several conditions appear to be needed for a terrestrial planet-like object to have a magnetic field generated by a dynamo:

*

*A core that is partially molten. Mercury, Venus, the Moon, and Mars all appear to have a partially molten core. This is not a sufficient condition.

*A sufficiently high rotation rate. What "sufficiently high" means is highly debated. Some say that even Venus' low rotation rate should be "sufficiently high" to support a dynamo. Others disagree.

*A "sufficiently high" heat transfer across the core-mantle boundary so as to get convection going. Once again, what "sufficiently high" means is highly debated. The heat transfer rate across the Earth's core-mantle boundary is not well constrained. Geophysicists who study and model geodynamos want a much higher rate than most geophysicists and geologists think exists.

The final item appears to be the key. (Some scientists say otherwise, but they are in the minority.) The key difference between the Earth and the other four objects (Mercury, Venus, the Moon, and Mars) is that the Earth has plate tectonics. All of the others have stagnant lid tectonics. The basic idea is that plate tectonics enables greater heat transfer in the mantle than does stagnant lid tectonics, and hence enables greater heat transfer across the core-mantle boundary.
