The primary function of the numbers was to prevent soldiers from mixing them up during field stripping, cleaning, etc. (as fiddler noted above).
It says so in the Soviet rifles field manuals: "When reassembling the rifle, ensure the numbers on the parts match, to prevent mixing up parts coming from different rifles."
But this meant that a rifle could not be issued with numbers not-matching.
The Repair manuals say that non-matching numbers are considered to be a defect and have to be rectified (i.e. with non-matching numbers, a rifle considered to be defective and not allowed to be issued to a soldier).
See for example "Manual on Medium Repair of SKS carbines, 4th edition, 1972", page 10, section 2. It says that the number have to match on: bolt, bolt carrier, extractor, gas piston, gas cylinder/handguard, receiver cover, magazine cover, trigger guard, and stock.
"Non-matching numbers on bolt, bolt carrier, receiver cover, magazine cover and trigger guard, are to be carefully stamped out, or struck out with a chisel.
Non-matching number on the stock is to be removed by sandpaper.
New numbers are applied by stamps next to the old number.
Non-matching numbers on extractor, gas piston, and gas cylinder are to be ground off by sandpaper, new number applied in the same place by sharp scribe, but electro-pencil is allowed too."
Now, these rules were followed by repair shops in the army. I don't know, if they followed the same rules when putting them away to the arsenals (I think they must have). Obviously they don't follow them anymore when removing them form arsenals for sale.