Sort:  

It's actually not a spanish word at all. It's slang, and was chosen by the US government in the 1930s as the official name for dried cannabis flower, to associate cannabis with Mexicans in the public eye, to make it sound foreign and scary. You're right that it wasn't dreamed up in a lab :)