He doesn’t know that he is in captivity. He doesn’t know you don’t have any intention of giving him a female. He only wants to be ready if one turns up.
Either he has worked out that he depends on you for everything, and his internal monologue is as follows:
“This big monkey gives me my food, fresh water and everything else, so when he sees I am ready to breed, he will also provide the female”.
Or else he has gone through a kind of utilitarian monologue in his brain, saying to himself:
“The existence of a desire for something predicts that it exists. I desire food when I am hungry and food comes. I desire for there to be an existence of God, and then God comes to me in my dreams. Now I desire the existence of something else, I don’t know what it is yet, but I know it must be something to do with that thing up there I got strangely driven to build out of my sticky saliva, and air. And when the thing that it is for comes along, I’ll know what it is.”