The phrase's principal meaning, in use at least since the 1970s, is a player or team who enters a tournament at the organisers' discretion. Originally it meant a card having any rank chosen by the player holding it (as in the Oxford English Dictionary's citation from Auction Bridge Magazine in 1927: "These are played with all the twos as jokers and usually known as `Deuces Wild' ").
It is unclear how "wild" came to be applied in a sporting sense - most uses of the word hinge upon the idea of something being out of control. It came via German from the prehistoric wilthijaz which was probably descended in turn from the Indo-European ghwelt- (source of the Welsh gwyllt, or "wild"). The derivative wilderness etymologically denotes the "condition of being a wild animal".
The earliest sporting citation in the OED is from New Yorker in 1970: "The other 13 games will be `wild-card' encounters to be played on alternate Monday nights." In 1976, the Brisbane Sunday Mail wrote: "Renee was not ranked high enough to be accepted on her standard of play, but she could be nominated as a `wild card'."