Quite simply because it feels good. Masturbation is a perfectly normal behaviour in mammals. As long as she isn't hurting anyone theres nothing wrong with it.
Is she spayed? Sometimes spaying will lessen the behaviour but not always.
Edit: just reread that she is spayed in the title. It probably is simply because it feels good.
For now, don't do a thing. IF she should progress to yowling and posturing (crouching with butt in the air, and tail to the side), consider having her hormone levels checked. Very occasionally, a bit of ovarian tissue can be left behind. But IndyJones
is right, masturbation is common across the mammal world, just because it feels good. Take a deep breath, and remind yourself that she is a cat, and morality doesn't come into it at all, in her world.
Many cats do this when they are happy, when they are remembering the love and safety of the nest and their mother. You'll notice it's the same motions as a kitten nursing, much like when a human baby lies on its back and open and closes its hands while making happy sounds. In short it means you are doing something right in taking care of your cat.