This is the duplicate item glitch.
It can happen to seemingly...ANY item. Although its far more common with armor and weapons that have a 'condition' stat.
Instead of doing simple arithmetic (which any of us can do in our sleep) the game adds the two inventory items together but they sort of occupy the same 'spot' in your inventory.
For weapons with variable condition (like the 10mm pistols this happened with for me) you will have 3 + 3 pounds of equipment but only have access to one of the guns. This, of course, means you can't repair one with the other.
This is the first I've heard of this glitch happening in random containers in the world. It happened in my personal inventory and in my personal wardrobe in the Novac safehouse.
You just have to sell/drop one group of them and only pick up one set of the throwing spears. Or sell both groups. Or use the 4 on enemies and the 6 will magically reappear in your inventory.