The Oxford English Dictionary suggests that - though the origin is obscure - it is a variant of 'spiff', which meant to dress up, and the adjective 'spiffy', meaning "dressed up to the nines", as it were.
A key feature of the spivs in the 1930s/1940s was the flashy and expensive way they dressed compared with the drab way most other men appeared. They could do that because they had lots of money from their blackmarket dealings.