I've heard that when dogs do this its because they believe they are the dominant one in your relationship. To break them of the habit, you're supposed to have a staring contest with them. First one to break eye-contact loses. When my fiance moved in with me, Sabby started marking all of his (my fiance's) stuff. So I told Justin to have a staring contest with Sabby. It seemed to work. If you try it, let me know how it goes.
I heard that sometimes its a symptom of being neutered too late (same with attempting to spray when they can't). I think it's common though. My friends 14 year old Lab (female) will try to hump you in you happen to be mistakenly in that position.