Just like spin of electron is similar to something spinning, but you shouldn't take it too literally, the magnetic field produced by spin is very much like that of a current loop, but again, you shouldn't take it too literally. There isn't anything actually spinning in there, so the analogy only goes so far.
The biggest difference between an electron and a planet is that electron is a point-particle. It has no dimension to it. In order for a ball to actually spin, it needs to have a size, and electron doesn't have it. The probability density of an electron can be distributed, but it still has the same spin at every point in space it can occupy.
The other part is the fact that the spin itself is half-integer. It quantizes the same way an orbital angular momentum would, but if there was an actual spinning object in there, it's wave function would not match itself after a 360° rotation. In fact, you need a 720° rotation for the wave function of electron to match itself in order for it to work as an actual rotation. And that actually manifests itself in the behavior of half-integer particles under permutation. If you switch any two electrons, the overall wave function changes sign. That's what results in different statistical behavior of fermions and bosons.
Mathematically, the electron's spin exists in a space spanned by SU(2) group. This has the feature described above. Because there exists a sort of 2:1 correspondence (a homomorphism, specifically) between SU(2) and SO(3), later describing rotations in 3D space, you effectively end up with spinors in SU(2) behaving like they are orientations in 3D space, but with "full rotation" being 720°.
It is not yet clear whether this actually corresponds to an SU(2) subspace of physical reality or just a mathematical curiosity caused by something else we don't understand. As far as why it causes magnetic field just like there is a current loop, I guess I can point to QED Lagrangian and say, "It follows from that," but it's probably not a satisfactory answer. Unfortunately, I can't really do better.