There is an easy explanation. It was captured and thrown into sexual slavery doing a Tijuana donkey show.
This may go over poorly, but.... Eso me hizo el día. Polly quiere una galleta. (Polly is referring to herself in the 3rd person.)
My cockatiel that I used to have copied a lot as well. He would've picked up Spanish words quickly. But I never gave him the chance since I don't know Spanish.