Wait a minute: it was a spell, right? A magic spell?
(Is it really necessary to argue physical laws when they don't apply?)
It could very well be that the spell itself does affect "metals" because of their inherent "metalness", just in the way that an alchemist could conceivably transmute lead to gold, but not wood to gold. Just another interesting property based on where the element is on the periodic table... So, while mundane magnetism works normally, the *spell* Magnetism does something similar but wildly more interesting. (Magic should be interesting.)
This is a failing the spell description, more than anything else. It should have set its paramaters more clearly in the description. What level is this spell?
In this particular case, the DM ruled in a very safe way... but also pretty much rules out any creative uses for the spell--on both sides of the DM screen--in the future. Sure, picking up gold with a magnet may be impossible, but causing an engineer an aneurism because you picked his pocket from a distance can be lots of fun.
On the flip side, if you set the precedent that all metals inherently have some potential magnetic property, then you're making some sweeping changes there, too. For example: ship's compasses would be useless. They're typically housed in brass--not steel--for that very reason. That would cause all navigators aneurisms.