Maybe your lovebird is a boy with a “wide stance.”
As I understand it, some species of Lovebirds are sexually dimorphic (meaning we should be able to visually discern the sex of the bird).
the sexually dimorphic species: Madagascar, Abyssinian, and red-headed lovebird
I have only had one parrot do this "humping" (masturbation). He was a DNA-tested-male Green-cheeked Conure. I think he figured it out by accident; but, once he figured it out, he knew how to get the desired effect when he wanted. He would typically use a "boing".
[EDIT: Guillermo, the Green-cheeked I just referred to, was a long-time foster, and he has found his forever home where he joined a Pineapple GCC named Gypsy. It has been about a month, and I am told they have made steady progress with becoming friends each and every day.]
It is highly unnatural―and asking a tremendous thing―to expect a parrot to be celibate their entire lives! Priests voluntarily take that oath and struggle with it. Call me crazy, but my solution is to get the parrot an opposite-sex companion.
Me: Oh, you want to "hump" something, do you? Let's get you the proper "thing" to hump, and sorry it took me so long."
Truth be told, playing parrot matchmaker is hard, and probably more a matter of luck. I have four Senegals; two males and two females. They've been together for a couple to a few years, and they are
still getting acquainted. All of them were only-parrots before I got them, so they are actually reluctant to get close to other parrots for a while. (That is a very sad sign of life in captivity for them.) They want to, then it gets uncomfortable when they get close, even if just for one of them.
Note, I am not looking to breed―at all. I am just not one to fixate on a goal of preventing a problem that may never exist. They pair-bond with a conspecific (same-species), opposite-sex parrot in the wild. It is a huge part of their nature and their full lives. I want them to have that opportunity here, even if the pickings are slim. :| It has presented me with many challenges and some struggles. I accept that.