The rubbing definitely sounds sexual, unless I'm misunderstanding what you're describing. As charmed mention, make sure there's nothing around stimulating hormonal behavior. Dark, nest-like areas, excess of sugars, fats or proteins, petting the back, under the wings, along the length of the tail, or (obviously) anywhere near the vent area.
Other than that, if relieving himself in this way doesn't bring about any other undesirable behavior, I'd say leave him be. Some birds will become more aggressive and such. But others just feel the need and find some fortuitously positioned object in the cage that does the trick. If your guy falls into the latter category, then why not?
As for trimming beaks and nails...
Jolly never needs his nails trimmed. And I've gotten Maya to the point where she only needs them trimmed maybe once every year and a half. This is because I put at least one of those specialized perches that wear down the nails in each of their cages. The concrete types. In front of their food bowls. This way, when they're doing their happy food dance, they wear down their nails. Very effective. (Note: all the other perches are wooden branch types. Having all concrete perches can irritate their foot pads.)
My ekkies have never needed beak trims. They handle beak maintenance themselves via the wood they chew in the cage, or the hard surfaces of some of their perches. There are some birds that don't do this enough, or others with either dietary issues or liver issues that cause beak overgrowth. But for those, it would depend upon the rate of growth. But as Noodles mentioned, don't give the beak trim just to do it. It should be medically necessary.