Magnetism is a manifestation of some very fundamental physics, ultimately linked to the orbital motion and spin of the electrons in atoms.
To answer the specific question though, of “Why are only some substances magnetic?” …
In a Nutshell : Everything is magnetic : water, wood – even frogs!
Certain arrangements of these spins – such as those in iron atoms- create intensely magnetic materials but as all substances contain spinning electrons, everything is magnetic: water, wood- even frogs. The reason we don’t think of them as magnetic is because the effect is pretty feeble, around a billion times weaker than in metals like iron.
Thus, while it is possible to pick up a toothpick using a magnet, it requires an intense magnetic field – around 200,000 times stronger than the Earth’s. It can be done: the German physicist Werner Braunbeck levitated small bits of apparently nonmagnetic graphite in 1939, while French physicists did the same with blobs of water in 1991. The most spectacular achievement so far came in 1997, when a team led by Or Andre Geim at the University of Nijmegen in the Netherlands succeeded in levitating a frog. And yes, humans could also be levitated- at least in principle. However, generating the necessary magnetic field would require the output of a nuclear power station, which seems a bit excessive for a party trick.