The only free and comprehensive online etymological dictionary of the Spanish language
joto, jota (3) m. & f. (Noun) (playing card) "joker," "jack;" "male homosexual"

Of unknown origin. Consider also jote.