The countries/governments these surplus guns come from don't have either the means, the customer base, or the will to sell their old guns. They can either sell them for scrap metal or maybe sell them to an importer/exporter for a little more than scrap metal prices. The importer brings them into the country, and now has to warehouse x number of pallets of old guns. They sell them at a price point where they make very good money, yet at a low enough price that they can sell the entire inventory in a few months to a few years time.
Sure a K-31 might have cost $1200 in today's money to make, but if you are sitting on 10,000 of them that you might have paid $20 ea for to purchase and import, you aren't going to sell them for $1200 ea- you'll lose money because you'll never sell more than a few, and will still have to carry the rest in inventory.