It's a dominance thing; even some females will do it. If she's not neutered, I would have that done. It can calm the dominance factor down. In the meantime, and afterward, scold her off whatever she is "dominating."
I know right?? We owned our dog from a PUPPY-puppy....she was barely 2 months old when we got her and she was the only dog in our house....yet somehow she knew how to "mount" legs and other objects....I never really understood where the behavior could have possibly came from since there was no other dogs to show her this "little stunt".....maybe she was spying through the bedroom door.....8)