K-2SO is one of the many highlights of Rogue One: A Star Wars Story.
What does K-2SO stand for?
According to official novelization by Alexander Freed, it was a part of his longer official designation:
Cassian had killed K-2SO (whose true designation was far longer and far grander, rich with meaning and history that described his factory of origin, the date and time of his initialization, and more) and brought him back both smaller and larger than he had been. K-2SO did not mourn for his old self, but there were times he grew wistful over what he had been.
As additional confirmation, this was true of all droids in pre-Disney canon.
Quoting from my own answer on SciFi.SE:
Pablo Hidalgo (Internet Content Provider for starwars.com) answered this conclusively in Q&A in Star Wars Insider #58 (Page 97)
He said that 4-letter robot names are just fragments of long serial numbers. And some droids don't even have a shorter 4-letter name for some, who instead get a real nickname (e.g. Corran Horn's Wistler).
Please note that the canonical status of Star Wars Insider information is questionable in new Disney canon, but Pablo Hidalgo is still pre-eminent canon expert at Lucasfilm Story Group, and as such the fact that a nearly identical fact was included in a canon novel probably means that the overall general rule also remain canonical.
We don't know specific reasons out of universe for the name (even interview with the actor Alan Tudyk offers no clues).
All we know is:
This towering, powerful security droid is described by Edwards as “the antithesis of C-3PO.” (Gareth Edwards to EW)
After doing some research online, and finding very little. My guess is K-2SO may be a chemistry joke.
K = Potassium
S = Sulphur
O = Oxygen
K2SO3 is Potassium Sulfite, a food preservative.
K-2SO fulfills the role of preserving Cassian and Jyn, saving them from "spoilage"
As Adeptus said, all droids have a 4 character alphanumeric name, shortening K2SO3 to K-2SO.
It gets more interesting:
the people he preserves have food related names:
According to the accepted answer on SFF.SE question: Do all droids have a four alphanumeric character name and does this have any significance?
4-letter robot names are just fragments of long serial numbers.
So, there is no in-universe significance to the name K-2SO, it is just a fragment of his serial number.
(Out-of-universe, there may be some significance, but I suspect the writers just thought it sounded good).
I like the chemical analogy. Here's a physics + Hewbrew gematria one that ties K-2SO with C-3PO. Assume K is temperature in degrees Kelvin, and C is temperature in degrees Celsius (°K = °C + 273). In Hebrew gematria S=90, P=60, and O=50. Assume these are factors to be multiplied:
K-2SO = 2 × 90 × 50 = 9,000°K
C-3PO = 3 × 60 × 50 = 9,000°C
The same product indicates K-2SO is a character equivalent replacement of C-3PO. And both temperatures correspond to A type stars (which include Vega and Sirius A). These may be just random letters and numbers, but that won't stop us from trying to assign meaning to them!*
*But lots of down votes when someone tries to might. The answer "Nothing" to the OP's question may be correct, but quoting K-2SO, "I thought it was boring."