It is perhaps best to start this out from the classical perspective. In classical electromagnetism, a spinning electrically-charged object generates a magnetic field due to the fact that the spinning of the charged object is charge in motion and thus technically is an electric current (even though it may not be what one thinks of an electric current which is where charges within the material are flowing with respect to other charges that are remaining stationary, while here the whole thing is in motion). This is Ampere's law.
Indeed, the guy for which that law is named was one of those to first indirectly observe evidence for what we'd now call as electron spin. You see, if you take an object carrying an electric current - and that would include a spinning static charge - and you put it in a magnetic field, a force is developed on the current thanks to the magnetic force law, $\mathbf{F}_\text{mag} = q\mathbf{v} \times \mathbf{B}$, and this is obvious in the case of electromagnets, where you have an electric circuit and run current through it. And what was a going hypothesis at the time was that electric currents must somehow account for all magnetic fields - but if that's the case, then we have a seeming problem: there exist so-called permanent magnets which were historically by far the first observations of what we now call magnetism, all the way back to ancient Greece (the terms "magnet" and "magnetism" themselves come from the name of a place in Greece, Magnesia, where lots of naturally magnetized ores [magnetite] could be found), and yet seem to possess no detectable internal current!
And that leaves the question of how to account for them, and what Ampere suggested was that it was due to so-called microcurrents (sadly with yet more eponymism also called Amperian currents) within the material, extraordinarily small, ever-flowing electric currents of some sort, each of which would have to be something akin to a tiny loop because otherwise you'd have a large-scale current, and which would each produce a small dipole, but by virtue of their phenomenal minuteness, would be unamenable to detection by an ordinary instrument. In some materials, those dipoles would line up, and you get a large-scale magnetic field; in others, they don't, and instead they contribute randomly and the fields average out to approximately nothing.
So from that alone, there's a strong hint that something in the material must be undergoing some sort of continuous motion that is resulting in the generation of these magnetic fields; but it was not clear what that was until better understandings of atomic structure and the nature of electric currents were probed more closely, and the electron was discovered and more importantly, was discovered by finding it to be separable from the rest of matter (this is typically done using a thermionic valve, i.e. a vacuum tube: heat up a filament like a lightbulb until it's glowing super hot - yellow hot, white hot - and it will be roiling with electrons which can be made known by suspending it in a suitable field), and thus allowing it to be moved about on its own independently of a material, and with that available, it was possible to probe its properties more closely, which revealed it to contain, in addition to its negative electric charge, a small but not zero dipole moment that is what you might expect were it a spinning object of some kind - at least, Ampere's famous micro-current.
Of course then we know with further work that quantum mechanics is a thing, and the behavior of these spins - and all other motions on the atomic scale - is very much different from Newtonian mechanics: from a very modern perspective, we'd say this results because the spin axis is ill-defined as to which way it points in space, in turn because, as an "elementary system" (as far as we know), the electron can only hold a single bit of information, and with a single bit, you have far too little to write down a complete $(\theta, \phi)$ pair-of-real-numbers spatial orientation for the axis of rotation of an object!
So basically, an earlier stage of systematically splitting up matter into smaller chunks, as has been going on in research all the way up until now.