Contrary to popular belief, birds do not have to copulate with other birds in order to lay eggs. This is one of many fascinating things I learned when I was little that turned me into a disturbed child. I own two female birds, both are cockatiels (no pun intended).
Many a night I have been woken by the sounds of my birds screeching in the throes of passion (No, they're not lesbian birds, they're in seperate cages). Now, at first, you may think this impossible, seeing as birds don't have opposable thumbs or some other means of inserting objects into their sexual area.
My birds however, have more masturbatory talents than the average human female. Their backs are very sensitive, and it is the area in which they like to be pet the most. They rub their backs against the nearest hanging toy or millet spray in the cage, and proceed to get off on it as if experiencing some wierd kind of seed fetish.
The cure to bird masturbation is to either find a mate, or to convert your bird to a religion that prohibits it.