Hard-boiled eggs are solid all the way through so when you spin the egg, all the energy you apply goes into spinning the whole object. Raw eggs have yolks that are free to move about the interior of the egg, however. So when you spin a raw egg the yolk moves to the outer edge of the inside of the egg, which consumes some of the energy you applied. The other difference you can see is what happens after you stop these two eggs from spinning. Stopping the hard-boiling egg stops the entire system, because the yolk is trapped in the solid, cooked egg white. Inside the raw egg, however, even after you stop it, the yolk is still spinning around. So if you take your finger off of a raw egg that was just spinning, it can start moving again, seemingly on its own.