Jugar (Spanish for “to play,” in the sense of a sport, not an instrument) and the English joke both, surprisingly, come from the same root: the Latin iocus, meaning, “joke, sport, pastime.”
Interesting: although the j-g of jugar maps to the j-k of joke, their meanings are sufficiently different so that, to an English speaker, the connection isn’t obvious.
Upon reflection, however, the key that binds them together is the other definition of iocus, “pastime”: both telling jokes and playing sports really are, indeed, pastimes.