Does the phrase "form follows function" mean anything to you?
You probably know it's an architectural saying but it's appropriate here.
Kalashnikov identified a necessary function for his famous weapon. He designed it to meet that function. The primary purpose is represented in the design. Kalashnikov probably didn't care that his weapon could be used for hammering in tent pegs, its purpose was to kill people.
You're confusing purpose with use, they're not the same. The purpose of a Kalashnikov is to kill people. It can be used to hammer in tent pegs, it can be used to belt people in the face with, it can be used to spray bullets at an old car body on a range. Its purpose isn't changed by temporary usage. Its purpose is in the mind of the designer, its purpose is to kill people. It can't be treated as a rather interesting hammer, even though it can be used as one, when it's plainly designed to kill people.
A hammer can be used to hammer in tent pegs. A hammer can be used to kill someone. Its primary purpose is to apply a lot of force over a small area and therefore to magnify the force being applied. The user decides if it's a tent peg or a human head that it's used on. But its primary purpose is not to kill people. So, it needn't be seen in the same light as an instrument whose primary purpose is to kill people.
So, again, purpose is not use. Purpose is the primary reason for design and construction. If Kalashnikov wrote a manual for his weapon I'd be surprised if he included a section on how to bash tent pegs into the ground.