Green’s Dictionary of Slang

number ten adj.

also number sixty-nine
[pidgin, imported by veterans of the wars in Korea (1950–3) and Vietnam (1964–75)]

[1950s+] (orig. US milit.) very bad, the worst.