Avocados originate from South America, where the Aztecs called them ahucatl, after their word for testicle. No explanation required there, although one hopes the analogy was based on shape rather than colour.
As we all know, the Spanish eventually arrived on American shores and, as conquering hordes are apt to do, decided that easier than getting their tongues around the natives' word (yes, I know what you're thinking, and shame on you) was using one of their own words which sounded similar. Thus ahucatl became avocado, the Spanish word for advocate.
And there the story could end, but then it wouldn't be much of a story, would it? Another popular name for avocados is alligator pears - again, for obvious reasons, given their dark green, knobbly skin. Now where do you think the word alligator comes from? Well, mis amigos, it's a mangling of the Spanish el legarto, aka the lizard.
Isn't that a nice symmetry? Those rotten Spanish conquistadors mess up a perfectly good Aztec word, then us English speakers take their messed up Aztec word and replace it with another word which is, itself, a messed up Spanish word. Ha! Anyone know the Spanish word for karma?