Yeah, i know "it's just the way it is" isn't a good answer, but if you're wondering why gravity affects everything with mass and magnetism doesn't, I'm not sure there's a better one. Someone smarter than me could probably talk about the subatomic particles involved, but in the end I don't know...