It is pretty stupid;
Firstly, not everything up there may be ferromagnetic, meaning a fuck-off gigantor XL electromagnet would have fuck-all effect on them.
But the real problems with using a magnet like that:
Firstly, a magnet like that WILL alter the trajectory of ferrous debris in its orbit. It will not have much control over where or how these trajectory alterations happen, but they will be pretty impressive - and uncontrolled.
Secondly, objects near a magnet do not magically adhere to the magnet. If an object is going too fast, on the wrong trajectory to be captured, you won't actually capture the object, you'll just change its trajectory, potentially exacerbating the problem.
Thirdly, magnets do not magically become one with whatever adheres to them. If you alter the trajectory of incoming space junk such that it intersects the magnet, you're going to potentially shatter both the magnet and the junk, vastly exacerbating the problem.
The orbital magnet would only work on a very small subset of space junk - that which is already basically on the same orbit, such that you're effectively docking with it anyway.
Now, COULD these objections be overcome? Yes. By no known technologies. If we're positing unknown technologies, you could simply sweep the skies clean with a science fiction tractor beam.